Fariba
Fariba

Reputation: 11

How to create connections to specific agents and show animate connections for agents in Anylogic

I am new to Anylogic and I am trying to do modeling using Anylogic. I'd like to connect 6 types of agents on a GIS environment by a network.

The condition for the connections is as follows: agent type 1 has 10 agents agent type 2 has 16 agents agent type 6 has 20 agents.

I want to connect agent1 with 2 based on the nearest distance. This means that an agent of type 1 is to be connected to the nearest agent of type 2.

Also, I want to connect populations of agent1 with each other.

I used "Link to Agent" for this purpose and animated connections by clicking the "draw line connecting agents" tickbox in the properties. The line connecting among agents isn't shown when I run the model however the results show agents are connected.

Got any suggestions (to show line connecting among agents)? Thanks.

Upvotes: 1

Views: 198

Answers (1)

Felipe
Felipe

Reputation: 9421

The "draw line" functionality of the connections generated by link to agents DOES NOT work on a GIS space.

I would call this a bug in AnyLogic.

To draw lines between agents that are connected, you need to code your own thing, which is not very straight forward considering that you can zoom in and zoom out the map, there's no built in functionality in AnyLogic that allows you to do this easily. Sometimes I use Gis Regions as lines to connect agents... But that works fine with static agents...

You can so generate new agents that are lines and define the position based on the map scale, but you can't zoom in or zoom out without breaking the connections.

In other words, you have to be creative depending on what your agents are.

Upvotes: 0

Related Questions