View source: R/directionalMove.R
This function moves the lobster a fixed distance which will be toward the trap (+some randomness) if within a zone of attraction. The closer the lobster is to the trap the smaller the random component of movement.
1 2 3 4 5 6 7 8 9 10 | directionalMove(
xLobster,
yLobster,
dStep,
distanceToTrap,
xtrap = 5,
ytrap = 5,
radius_of_influence = 15,
ZoI
)
|
xLobster |
location lobster in x direction |
yLobster |
location of a lobster in y direction |
dStep |
is how much a lobster moves in each time step |
distanceToTrap |
how much influence the trap has on movement |
xtrap |
location of the closest trap in the x direction |
ytrap |
location of the trap in y direction |
radius_of_influence |
how large is the attraction zone for the trap at t0 |
ZoI |
is trap's zone of influence which gets updated in each timestep |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.