Create an agent in a predetermined grid location.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Create an agent in a predetermined grid location.

Gerardo Leo
Hello everyone, 

as well as written in the title, I need to add some agents to a precise position in grid, I don't want that adding them on the context they are generated randomly in the simulation scenario.

To be more specifically, I read the map from a PGM file and add it to a value layer, in this way I can indicate walls, exit and other stuff using the different numbers in the file. 
I would like to create a class "Exit", characterized by its own features, and add it right where indicated in the PGM file .
The same I would like to do with other agents (for example "security agents").

I hope someone could help. 
Thank you very much.
Gerardo 


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: Create an agent in a predetermined grid location.

srcnick
Gerado,

If you create the Grid with a SimpleGridAdder rather than a RandomGridAdder, then the agents will not be placed randomly in the grid when added to the context. You will need to explicitly assign them a gird location.

Nick

On Sep 26, 2016, at 11:43 PM, Gerardo Leo <[hidden email]> wrote:

Hello everyone, 

as well as written in the title, I need to add some agents to a precise position in grid, I don't want that adding them on the context they are generated randomly in the simulation scenario.

To be more specifically, I read the map from a PGM file and add it to a value layer, in this way I can indicate walls, exit and other stuff using the different numbers in the file. 
I would like to create a class "Exit", characterized by its own features, and add it right where indicated in the PGM file .
The same I would like to do with other agents (for example "security agents").

I hope someone could help. 
Thank you very much.
Gerardo 

------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest