0
votes

So in this model I have several hospital-agents that are placed randomly in an area. These hospitals contains a process flow and at some point in this process flow a new agent 'Bones' is generated, using a split block. The location of these Bones-agents is correctly specified by setting it equal to the (x,y) coordinates of the hospital.

Now I want to make the model more realistic by placing the hospitals in actual location in a GIS map. I did this with success. However, now I need to re-specify the location of the Bones-agents. At the moment of generating the first Bones-agent, I get the follow error:

root.Hospital1.splitblock: 
Error when trying to initialize new agent 
Caused by: root.Hospital2: 
This agent is already defined as agent living in space 'Continuous, based on 
GIS map' and can't have behaviour for space 'Continuous'This agent is already 
defined as agent living in space 'Continuous, based on GIS map' and can't 
have behaviour for space 'Continuous'

What do I need to do to make this work? I have tried setting the location of the Bones-agent equal to the longitude and latitude of the hospital agent with a function:

double longitude = getLongitude();
return longitude;

I did the same for het latitude. I then inputted these functions in the 'latitude' fields of the split block.

1

1 Answers

1
votes

When you develop a model, you have to choose what kind of space you will use. Remember that all the canvas in which you put agents, and the map and stuff is based on a scale, so you can't mix a map with elements that are created with the space markup (with space markup i mean nodes, paths, rectangular nodes etc).

So the bones agents should also be placed in the map... It seems that you are not doing that, and you are probably placing the bones agent using the space markup.

But it's possible to do this of course, but you have to do it in another agent. Create a new agent called continuousSpace for instance, and place your bones agents there.

After that you will have to create a navigation button using viewAreas (from the presentation palette) to move from one agent to the other (meaning from the gis space to the markup space).

Otherwise, you can also place the bonesagents in the gis space (in the map) and it will also work.

Good luck :)