GRASS logo

NAME

r.agent.aco - Agents wander around on the terrain, marking paths to new locations.

KEYWORDS

SYNOPSIS

r.agent.aco
r.agent.aco --help
r.agent.aco [-pscal] outputmap=string [inputmap=string] costmap=string sitesmap=string rounds=integer [outrounds=integer] [targetvisibility=integer] [highcostlimit=integer] [lowcostlimit=integer] [maxpheromone=integer] [minpheromone=integer] [volatilizationtime=integer] [stepintensity=integer] [pathintensity=integer] [maxants=integer] [antslife=integer] decisionalgorithm=string evaluateposition=string [agentfreedom=integer] pheromoneweight=integer randomnessweight=integer costweight=integer [--help] [--verbose] [--quiet] [--ui]

Flags:

-p
Allow overwriting existing pheromone maps
-s
Produce a sequence of pheromone maps (by appending a number)
-c
Overwrite existing cost map (only used with penalty conversion)
-a
Auto-convert cost (slope..) to penalty map (using "tobler", see docu)
-l
Avoid loops on the way back
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

outputmap=string [required]
Name of pheromone output map
inputmap=string
Name of input pheromone raster map (e.g. from prior run)
costmap=string [required]
Name of penalty resp. cost raster map (note conversion checkbox)
sitesmap=string [required]
Name of sites map, vector data with possible points of origin
rounds=integer [required]
Number of iterations/rounds to run
Options: 0-999999
Default: 999
outrounds=integer
Produce output after running this number of iterations/rounds
Options: 0-999999
targetvisibility=integer
Distance to target from where it might be 'sensed'
Options: 0-999999
highcostlimit=integer
Penalty values above this point an ant considers as illegal/bogus when in 'costlymarked' modus
Options: 0-<max integer on system would make sense>
lowcostlimit=integer
Penalty values below this point an ant considers as illegal/bogus when in 'costlymarked' modus
Options: -99999-99999
maxpheromone=integer
Absolute maximum of pheromone intensity a position may have
Options: <minpheromone>-<max integer on system would make sense>
minpheromone=integer
Absolute minimum of pheromone intensity to leave on playground
Options: 0-<maxpheromone>
volatilizationtime=integer
Half-life for pheromone to volatize (e.g. =rounds)
Options: 0-<max integer on system would make sense>
stepintensity=integer
Pheromone intensity to leave on each step
Options: 0-<max integer on system would make sense>
pathintensity=integer
Pheromone intensity to leave on found paths
Options: 0-<max integer on system would make sense>
maxants=integer
Maximum amount of ants that may live concurrently (x*y)
Options: 0-<the bigger the playground, the more space they have>
antslife=integer
Time to live for an ant (e.g. four times points distance)
Options: 0-<max integer on system would make sense>
decisionalgorithm=string [required]
Algorithm used for walking step
Options: standard, marked, costlymarked, random, test
Default: standard
evaluateposition=string [required]
Algorithm used for finding and remembering paths
Options: standard, avoidloop, forgetloop, avoidorforgetloop
Default: avoidorforgetloop
agentfreedom=integer
Number of possible directions the ant can take (4 or 8)
Options: 4, 8
pheromoneweight=integer [required]
How is the pheromone value (P) weighted when walking (p*P:r*R:c*C)
Options: 0-99999
Default: 1
randomnessweight=integer [required]
How is the random value (R) weighted when walking (p*P:r*R:c*C)
Options: 0-99999
Default: 1
costweight=integer [required]
How is the penalty value (C) weighted when walking (p*P:r*R:c*C)
Options: 0-99999
Default: 0

Table of contents

DESCRIPTION

As a first real example of a world there is an ACO-based environment (see Ant Colony Optimization) available.

The basic concept of such an ACO world, is to take some cost surface and transform it to a penalty layer. Even if the algorithm comes from the realm of insects, it might be adopted to different animal kingdoms. Depending on the type of agent this penalty layer must be reinterpreted: if for example we want to talk about human agents the penalty layer may be expressed by the walking velocity, e.g. calculated with the algorithm proposed by Tobler1993. The actors on the playground will wander around on the playground using the time for their paths that correspond with the values in the penalty grid. If they find some attractor, they walk home to the position they originated, marking their way with pheromones. While this pheromone vanishes over time, the following agents are more likely to choose their next steps to a position that smells most.

This first toolset was mainly developed for Topoi Project A-III-4, with some inspirations from previous work conducted at the Uni Bern in 2008.

NOTES

The state of this software is: "first do it".

ACO works best on dynamic maps -- it constantly tries to improve paths...

EXAMPLE

A fictive usecase could look something like this (note: at the moment the in- and output variables with libold, are still ascii-files):

r.agent.aco outputmap=out.map penaltymap=testpenalty.grid \
  sitesmap=sites.vect rounds=100 outrounds=100 volatilizationtime=5000 \
  antslife=2000 maxants=400 pathintensity=1000000

For running the total test suite on the libraries, i.e. to run all the tests that are at the end of each python file, use this test collection (for certain tests, the following files must exist though: "elev.grid", and "arch.vect"):

user@host:~$ cd /<pathtoaddons>/r.agent/libagent

user@host:libold$ ./alltests.py

TODO

Integrate it directly within grass.

Improve encapsulation of classes.

Find good parameters, or parameter finding strategies for the ACO part. Try to avoid high penalty fields. Think about heuristics too.

Implement other ABM scenarios.

SEE ALSO

AUTHORS

Michael Lustenberger inofix.ch

Last changed: $Date: 2015-11-11 21:14:59 +0100 (Wed, 11 Nov 2015) $

SOURCE CODE

Available at: r.agent.aco source code (history)


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2019 GRASS Development Team, GRASS GIS 7.4.5svn Reference Manual