Get started

Ctrl K

An implementation of random walk in Python, which defines an agent class `Walker` capable of random walk movement based on random angle and movement step distance in a continuous 2D space.

1

contributor

Get started

An implementation of random walk in Python, which defines an agent class `Walker`

capable of random walk movement based on random angle and movement step distance in a continuous 2D space.

Name | Type | Description |
---|---|---|

worldDimensions | dictionary (Dict) | The 2D world dimensions or limits. Specifically, the minimum and maximum coordinates in x and y that are considered valid positions in space. It is a dictionary with 'x' and 'y' keys, each associated to a two-item tupple of floats, representing minimum and maximum coordinates; e.g. {'x':(-50,50), 'y':(-50,50)} |

angleLeftMax, angleRightMax | float | Left and right angles in relation to an agent current angular direction that mark the maximum range of stochastic variation in direction for a step in a random walks. Both values must be set within the 0-180 interval. If both are set to 180, the direction of the previous step will have no impact on the direction of the next step (i.e. angle will be sampled from a 0-360 degrees interval). |

moveDistanceMin, moveDistanceMax | float | Minimum and maximum distance travelled after a step. When moveDistanceMin is less than moveDistanceMax, these mark the maximum range of stochastic variation in distance per step. If these are equal, distance travelled per step will be constant. MoveDistanceMin must be a positive number equal to or less than MoveDistanceMin. MoveDistanceMin must be a positive number equal to or greater than MoveDistanceMin, but less than the maximum world distance set by worldDimensions. |

(initial) x, y | float | Initial x and y coordinates of the agent's position. |

Name | Type | Description |
---|---|---|

positionX, positionY | float | The agent's position in x and y coordinates within the 2D space set by worldDimensions. |

direction | float | The agent's angular direction in degrees. |

Language

- Python

Modelling

- agent behaviour (self)

Module type

- Algorithm

Programming

- Nondeterministic
- Object-oriented

Subject

- random walk

Keywords

License

</>Source code

AA

Andreas Angourakis

Author, Copyright Holder, Creator