Xadash
Xadash

Reputation: 13

Is there a possibility to generate agents with a database in anylogic?

I'm new to Anylogic and I hope there isn't already a question and solution for my problem. I want to simulate the arrival and departure aircraft of an airport and I'm nearly done. Up to now I just created my agents with an event and checked my other functions. The actions of my agents are defined by a statechart. Now I wanted to generate the agents with a database (so that they appear to a certain time at a point in the vicinity of the airport), but the only solution I found was the source-block of the Process Modeling Library. I don't know how I could use the source block in my situation, because I don't have a process model, just the agent-based model with the flowchart.

If i set the Population of the agents to "loaded from database", every aircraft is generated at model start and note by the time it should be created.

Thank you very much for your help!

Upvotes: 1

Views: 52

Answers (2)

Enrico
Enrico

Reputation: 659

Another option would be to create an additional state with a name similar to BeforeEnterSimulation. The agents can be spawned at model start, and they sit in this state until the time specified which sould have been read as a parameter and thus can be used on the state transition.

Upvotes: 0

Benjamin
Benjamin

Reputation: 12795

Many different options are possible. One way:

  1. Create a DynamicEvent that instantiates 1 aircraft
  2. on model start, loop through your input data. For each row, call create_MyDynamicEvent and pass the data from the row, including when it should be triggered
  3. done

See the help and example models to understand DEs, they are fundamentally different from normal events

Upvotes: 1

Related Questions