Phase 1. Creating a Simple Model

First, we will create the simplest queueing model simulating how customers are serviced at the ATM.

 Create a new model

  1. Click the New   toolbar button. The New Model dialog box is displayed.

  2. Specify the name of the model. Type Bank In the Model name edit box.

  1. 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.

  2. Select minutes as the Model time units.

  3. 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. 

In the center of the workspace you will see the graphical editor. It shows the diagram of the Main type.

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.

Creating the flowchart defining the process

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

  1. After you create the model, AnyLogic will switch to the Palette view and display the Process Modeling Library palette:

  1. Add Process Modeling Library blocks on the diagram and connect them as shown in the figure below. To add a flowchart block on the diagram, drag the required element from the palette into the graphical editor.

  1. While dragging the blocks, and placing them close to each other, you may see the lines connecting the blocks appear. Please note that these connectors should connect only the ports lying on right and left borders of the block icons.

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

  1. To modify properties of some model element, first select it by clicking on it in the graphical editor or in the Projects view. This opens the properties of this element in the Properties view. 
  2. Select source block. In the Properties view, specify how often customers arrive. Type 0.3 and select per minute for Arrival rate

  1. Modify the properties of the queue. Set queue capacity to 15 agents. At most 15 customers will wait in a queue.


  1. Modify the properties of the delay. Name the object ATM. Specify the processing time. Assume that processing time is triangularly distributed with mean value of 1.5, min of 0.8 and max value of 3.5 minutes


triangular() function is the standard AnyLogic random number generator. AnyLogic provides also other random number distributions, like normalPoisson, exponential, etc. Please refer to AnyLogic Help for the description of all the random number generators (see AnyLogic Functions topic).

Running the model

Now we have finished modeling the simplest queuing system and we are ready to run the resulting model. First, build your model by clicking the Build Model toolbar button. If there are some errors in your model, the building fails and the Problems view appears listing all the errors found in your model. Double-click an error in the list to open the location of the error and fix it.

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

  1. 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 model

          Phase 2, Creating model animation