user3662357
user3662357

Reputation: 91

Move population of agents to top layer

I'm creating a population of agents dynamically using java. While doing so I also create several other shapes, which are partly overlaying. I already learned, that it's not possible to change the stacking order of a shape during runtime. This is easily solved by changing the order of creation in the code.

Somehow this doesnt't work for a population of agents. How I create the agents:

WindTurbine WT = add_windTurbines();
WT.setXY(posX,  posY); 

This population is partly hidden under other shapes. Is there a way to get it to the front?

Here is the model reduced to all necessary parts. The pipes are overlaying the wind turbines in the 2D View. The pipes should be under the turbines. The turbines are created by using replications and by using code in "On startup:" window.

Model ZIP

Upvotes: 0

Views: 239

Answers (1)

Felipe
Felipe

Reputation: 9421

This should work:

go to your population in main, click on the shape that represents your agent, right click, and select bring to front.

example with forklift

If your population is not defined in main because it's an agent type, I think you should create the population and in your flowchart source add agents to custom population (if you are using the Processing Library or discrete events).. not sure if all these steps are necessary, but try it out.

Upvotes: 1

Related Questions