Skip to content

r.agent.rand

Agents wander around on the terrain, marking paths to new locations.

r.agent.rand [-p] outputmap=string costmap=string rounds=integer [mark=integer] [maxagents=integer] [agentslife=integer] [agentfreedom=integer] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.agent.rand outputmap=string costmap=string rounds=999

grass.script.run_command("r.agent.rand", outputmap, costmap, rounds=999, mark=None, maxagents=None, agentslife=None, agentfreedom=None, flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.agent.rand", outputmap="string", costmap="string", rounds=999)

Parameters

outputmap=string [required]
    Name of step output map
costmap=string [required]
    Name of penalty resp. cost raster map (note conversion checkbox)
rounds=integer [required]
    Number of iterations/rounds to run
    Allowed values: 0-999999
    Default: 999
mark=integer
    Mark each step an agent takes
    Allowed values: 0-
maxagents=integer
    Maximum amount of agents that may live concurrently (x*y)
    Allowed values: 0-
agentslife=integer
    Time to live for an agent
    Allowed values: 0-
agentfreedom=integer
    Number of possible directions the ant can take (4 or 8)
    Allowed values: 4, 8
-p
    Allow overwriting existing output maps
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

outputmap : str, required
    Name of step output map
    Used as: input, raster
costmap : str, required
    Name of penalty resp. cost raster map (note conversion checkbox)
    Used as: input, raster
rounds : int, required
    Number of iterations/rounds to run
    Used as:
    Allowed values: 0-999999
    Default: 999
mark : int, optional
    Mark each step an agent takes
    Used as:
    Allowed values: 0-
maxagents : int, optional
    Maximum amount of agents that may live concurrently (x*y)
    Used as:
    Allowed values: 0-
agentslife : int, optional
    Time to live for an agent
    Used as:
    Allowed values: 0-
agentfreedom : int, optional
    Number of possible directions the ant can take (4 or 8)
    Used as:
    Allowed values: 4, 8
flags : str, optional
    Allowed values: p
    p
        Allow overwriting existing output maps
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

This submodule - r.agent.rand - is nothing but an example of how the libagent library might be used to get a simple setup running.

NOTES

As the name suggests, r.agent.rand lets agents wander around just based on chance. You only need to define a single input map, just some raster map, that will be completely ignored, it is only used to set the frame for the agents to come.

SEE ALSO

AUTHOR

Michael Lustenberger inofix.ch

SOURCE CODE

Available at: r.agent.rand source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819