metametascape
Welcome, Guest
Please Login or Register.
Lost Password?
Re:Grid from file (1 viewing)
_GEN_GOTOBOTTOM Post Reply

TOPIC: Re:Grid from file

#124
King (User)
Fresh Boarder
Posts: 1
graphgraph
Grid from file 2008/03/23 00:45 Karma: 0  
Is there any way to import information from a file into a grid (attribute of a grid agent) using metaabm. I have a risk surface that I would like to use to create spawn rules for agents, it is in ascii format.
  The administrator has disabled public write access.
#125
miles (Admin)
Admin
Posts: 59
graphgraph
Re:Grid from file 2008/03/23 03:52 Karma: 1  
Hi,

Not as part of metaABM proper. That is definitely an important future feature, but it would probably be part of a comprehensive set of runtime tools unless there was a use case we needed to take care of before then.

Until then, one thing to do is to create an Initialize with a Method Act for your root context that reads in the data file and in the code body open the file and assign the values to each agent. (The agents should have been created at that point.) If you are using Simphony, IIRC there are mechanisms for specifying this as part of the configuration data, but I'm not sure. For Ascape as target you could look at the edu.brook.aa.LHV model as an example of reading in binary data. Of course either solution will create some target dependencies.

I think the *best* way to handle this though a bit more trouble is to actually create a class, like "AgentLoader" with a method for loading and then create versions for each of your target platforms. Then you can simply instantiate the implementation and call the method (passing your model as an object) from your Method Act. Its good practice if you must use Methods to keep the calls as short and abstract as possible.

It occurs to me that this is actually a good use case for providing explicit spatial "location" methods, as then you could create everything with some Java but no ABM engine target specific code.

Oh, one more thought. You could write target specific import code and then use either the Ascape "save and load" and Simphony "freezedry" capabilities to save model state from the point in which you start your Repast or Ascape models.


hth,

Miles

Post edited by: miles, at: 2008/03/23 04:05
  The administrator has disabled public write access.
#244
pp1234 (Visitor)
Expert Boarder
Posts: 30
graphgraph
WOW Gold 2011/11/01 08:37 Karma: 0  
Stay, WOW Gold will only bring more trouble! Also remind you that, Runescape Gold sale while doing things don't indecision. I remember survival road, cheap Runescape Gold so a words: "alone, no matter you will surely tragedy actors take what weapons, back what medicine package".
  The administrator has disabled public write access.
_GEN_GOTOTOP Post Reply
© Copyright 2007 Best of Joomla, Powered by FireBoardget the latest posts directly to your desktop