giving agents as input

23 views
Skip to first unread message

Albert Jornet Puig

unread,
Jul 16, 2014, 2:30:29 PM7/16/14
to pandor...@googlegroups.com
Hi,

I would like to load agents from an input file such as config.xml (or any other file) in order to define agents.

WorldXXXConfig should only load environment data. For this purpose, it is not possible to access to getNumTasks (AFAIK it is an important method). The way I see, I might pass World as an argument. But it does not look a clean and any other example has done it neither.

Also, XXXWorld has no access to xml files.

Any ideas for a clean solution? Maybe I missed some details

Any help appreciate it
Thanks!

Xavier Rubio

unread,
Jul 18, 2014, 5:03:20 AM7/18/14
to Albert Jornet Puig, pandor...@googlegroups.com
Hi Albert, the Config class is strictly related to the parameters of
the model, and for this reason getNumTasks is not available (model run
should be independent of the hardware configuration). Why do you need
that inside the Config class?

Regarding your problem, I think that the best option might be to load
the XML file with the agents position in World::createAgents, as it is
done with a collection of agents stored in a georeferenced Shapefile
map:
(c++ version)
https://github.com/xrubio/pandora/tree/master/tests/functionalTests/cppFunctionalTests/loadAgentsFromShapefile
(python version)
https://github.com/xrubio/pandora/blob/master/tests/functionalTests/pythonFunctionalTests/loadAgentsFromShapefile/loadAgentsFromShapefile.py

Maybe we could have a class similar to ShpLoader:
https://github.com/xrubio/pandora/blob/master/include/ShpLoader.hxx
that could be used in World::createAgents to load agents from an XML
file using TinyXML (already used for Config).

What do you think?

Xavi
> --
> You received this message because you are subscribed to the Google Groups
> "Pandora users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandora_user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Albert Jornet Puig

unread,
Jul 21, 2014, 3:55:39 AM7/21/14
to pandor...@googlegroups.com, jur...@gmail.com
Hi Xavi,

Now It makes sense to make. I did not know where to load agents so I was confused.

Your suggestion seems logic so I agree.

Yes, I like the idea.


Another question, what about loading elements for the world from a XML? Such as towns.


El divendres 18 de juliol de 2014 11:03:20 UTC+2, Xavier Rubio va escriure:

Xavier Rubio

unread,
Jul 23, 2014, 8:59:22 AM7/23/14
to Albert Jornet Puig, pandor...@googlegroups.com
Hi, it depends if the towns do not have behavior the best option would
be to create a raster with their positions and attributes (if any).
On the other hand you could create very basic agents, one for each
town...it really depends on what your needs are. You can check, as an
example, the pandora version of the virtual anazasi:
https://github.com/xrubio/pandora/blob/master/examples/anasazi/virtualAnasazi.py

All best,

Xavi
Reply all
Reply to author
Forward
0 new messages