Random Movement
This behavior causes an agent to move by a random amount.
Published by
Shortname
@hash/random_movement.rs
Description

This behavior causes an agent to move by a random amount.

This amount is defined in random_movement_step_size (and defaults to 1).

If random_movement_seek_min_neighbors or random_movement_seek_max_neighbors is defined, then the agent will stop moving if it has an amount of neighbors falling in the specified range.

Example

This agent will move 0 or 3 spaces up/down and left/right, until it has at least 5 neighbors:

const attentionSeekingAgent = {
    behaviors: ["random_movement"],
    position: [6, 3],
    random_movement_step_size: 3,
    random_movement_seek_min_neighbors: 5
}