Saving snapshots of a headless simulation centered on a specific agent. #53
-
I am trying to run a GAMA simulation in addition to a python script that recommends to the agents in the simulation which places to visit in the simulation. We are using gama-gym and calling the expression: This accesses our global display and takes a smaller section out of it and saves it for further use.
If no dimension is given to snapshot it returns a cropped image with the size of 500x500. The issue now is that if i wanted to position the clipped image with a specific agent/location in the middle I need to get the agents location, for the building we want to inspect this is returned as {14421,12372} from GAMA. I assume this is in the coordinate system which gama uses internally? Is there some way to get the maximum of this internal coordinate system, or convert this to the cropped dimension. If there is an easier way to achieve my goal I am open to suggestions. |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 2 replies
-
Hi, |
Beta Was this translation helpful? Give feedback.
Hi,
{14421,12372} is GIS location within GAMA's coordination. I dont know an operator in GAMA for your issue, but i have a solution:
You have the boundary in GAMA : the world.shape, for ex {1000.1000} to {2000,2000}
You have the boundary of your snapshot: {0,0} to {2048,2048}
So doing a simple math , i think you can convert an agent location from GAMA coordinates, to where it state on your snapshot.