Create a new model
Click the New toolbar button. The New Model dialog box is displayed.
Specify the name of the model. Type Bank In the Model name edit box.
Specify the location where you want to store your model files. Browse for the existing folder using the Browse button, or type the name of the folder you want to create in the Location edit box.
Select minutes as the Model time units.
Click Finish to complete the process.
New model is created. It already has one agent type called Main and experiment called Simulation. Agents are the main building blocks of AnyLogic model. In our case Main agent will serve as the place where will define all the logic of the model: here we will put the process flowchart, and define some simple animation.
center of the
workspace you will see the graphical editor. It shows the
of the Main
To the left of the graphical editor you can see the Projects view and the Palette view sharing the same area. The Projects view provides access to AnyLogic models currently opened in the workspace. The workspace tree provides easy navigation throughout the models. The Palette view contains all graphical elements you can add onto the graphical editor of your agent just by drag'n'drop. Model elements are grouped by categories in a number of palettes.
On the right side of the workspace you can see the Properties view. The Properties view is used to view and modify the properties of a currently selected model element(s). When you select something – e.g., in the Projects view or in the graphical editor – the Properties view displays the properties of the selection.
Now we can start developing the model.
Now we will define the process with a flowchart
composed from Process
Modeling Library blocks.
Each block here defines some operation that will be performed with agents passing through this block.
In AnyLogic you create flowcharts by adding the blocks from the library palette to the graphical diagram, connecting blocks together, and tuning the parameters of the blocks.
Create the model flowchart
The given flowchart models the simplest queuing system, consisting of a source of agents, delay (and a queue before this delay) and final sink object.
Let's say a pair of words about these flowchart blocks.
Source block generates agents. It is usually used as a starting point of the process flow. In our example, it models customer arrival.
Queue block models queues. In this model it simulates a queue of customers waiting for the moment they can start accessing ATM services.
Delay here simulates the delay associated with the service at ATM.
Sink block indicates the end of the flowchart and discards the incoming agents.
Please refer to Process Modeling Library Reference Guide for the detailed information about all Process Modeling Library blocks.
Configure the flowchart blocks
Modify the properties of the queue. Set queue capacity to 15 agents. At most 15 customers will wait in a queue.
function is the
standard AnyLogic random number generator. AnyLogic provides also other
random number distributions, like normal, Poisson, exponential, etc.
Please refer to
all the random
number generators (see AnyLogic
After the model is successfully built, you can start it. Running the simulation, you automatically bring the current model up to date.
Start the model
Click the Run toolbar button and choose the experiment you want to run from the drop-down list. Your simulation experiment is called Bank/Simulation.
In the case this model is the only one opened in the workspace at the moment you will be prompted to run this particular experiment. Later on this button will start the previously run experiment. To run any other experiment, right-click (Mac OS: Ctrl+click) the experiment in the Projects view and choose Run from the context menu.Having started the model, you will see the model window. It displays the presentation designed for your simulation experiment.
Click the Run button in the control panel at the bottom of the model window.
You will see animated flowchart. Each model created with Process Modeling Library instantly has animated flowchart where you can see detailed current object status, for example queue size, number of agents left and so on – completely in graphics!
If needed, adjust the execution speed to your needs using Slow down and Speed up buttons in the control panel.
You can inspect flowchart objects to get the detailed information on their current state. Click on the object to open its inspect window. Inspect window show statistics on the object, e.g. Queue object's inspect shows the queue capacity, the number of agents passed through either port of the object and also whether the timeout option is enabled for this queue. Contains string displays the number of agents currently being in the object along with IDs of these agents.
Reference model: Bank - Phase 1
Bank Office modelPhase 2, Creating model animation