View source: R/directionalMove.R
directionalMove | R Documentation |
This function controls the movements of lobsters toward the trap. There are both directional and random move components considered in this function. The proximity of a lobster to a trap controls the magnitude of each components, i.e closer a lobster gets to the trap the smaller the random component of movement. The directional move depends on radius of influence of a trap and current zone of influence.
directionalMove(
Lobster,
dStep,
minDistoTrap,
Trap,
radiusOfInfluence,
currentZoI
)
Lobster |
location of lobster in the grid in x and y coordinates. |
dStep |
defines the distance that each lobster moves in each time step. |
minDistoTrap |
defines the minimum distance to the trap. |
Trap |
location of trap in the grid in x and y coordinates. |
radiusOfInfluence |
trap's radius of influence. |
currentZoI |
initial zone of influence |
Returns the new coordinates of each lobster in the grid after a directional move is applied.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.