[GRASS-SVN] r66810 - grass-addons/grass7/raster/r.agent/r.agent.rand
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Nov 11 10:24:54 PST 2015
Author: mic
Date: 2015-11-11 10:24:54 -0800 (Wed, 11 Nov 2015)
New Revision: 66810
Modified:
grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py
Log:
change the output raster layer
Modified: grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py
===================================================================
--- grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py 2015-11-11 18:19:42 UTC (rev 66809)
+++ grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py 2015-11-11 18:24:54 UTC (rev 66810)
@@ -117,8 +117,8 @@
raise error.DataError("r.agent.rand:", "The output map is mandatory.")
world.playground.grassmapnames['RESULT'] = output
#TODO hopefully not really needed - workaround for broken(?) garray
- world.playground.createlayer("copy", output, True)
- world.playground.grassmapnames["copy"] = output
+# world.playground.createlayer("copy", output, True)
+# world.playground.grassmapnames["copy"] = output
def run(rounds, maxagents, agentlife, mark, overwrite):
"""
@@ -132,8 +132,10 @@
agent.step()
position = agent.getposition()
newvalue = world.playground.getcellvalue('RESULT', position) + mark
+ if options['verbose']:
+ grass.message("setting " + positon + " to new value " + newvalue)
world.playground.setcellvalue('RESULT', positon, newvalue)
- world.playground.writelayer("copy", False, overwrite)
+ world.playground.writelayer('RESULT', False, overwrite)
def main():
try:
More information about the grass-commit
mailing list