In the first phase, we will create a simple model simulating a pedestrian flow: how people move inside our building.
Create a new model
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 the Main agent will serve as the place where will define all the logic of the model: here we will put the drawing of the entrance hall, and define the flowchart describing the pedestrian flow process.
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.
When creating a pedestrian dynamics simulation model, you always start with adding a layout image (drawing) of the simulated space (building). Then you draw the walls on top of this image and define the process logic: how the pedestrians move inside this building.
We will use the following layout:
Save the subway entrance hall layout to your computer
Add the subway entrance hall layout
First, open the Presentation palette of the Palette view. This palette contains shapes you can add on your presentation.
To open a palette, just click on the corresponding icon in the vertical ribbon docked to the left part of the palette. While you are not accustomed to the palette icons, you may hover the mouse over the ribbon and wait for the popup window to appear. It will show you the names of all palettes.
Drag the
Image
element from the
Presentation
palette on the graphical diagram.
Choose
the image file to be displayed by this shape. The file browser will
open automatically. Browse to the folder where you just saved the
layout image file, select it, and then click Open
in the dialog box.
Just few zones are marked on this drawing. We want to experiment with different layouts and do not know right now where the ticket offices and ticket vending machines area will be located. That is the reason these areas are not marked on the drawing.
Now we will mark up the space of our model. Usually we start with drawing the building walls.
Draw the building walls
Draw an entry line first. Entry is a place where pedestrians appear in the simulated environment. You define the start line for the pedestrian flow with a special markup element Target Line.
We want to draw the entry line right where we have the ENTRANCE text on our drawing.
Draw the line where passengers appear
Now let's add one more target line that will define the place where the passengers will move when entering the subway entrance hall.
We want them to move to subway trains, so let's place this target line just over the text TO TRAINS.
Draw the target line
Now we will finish creating the simple model simulating passenger flow. We will define the pedestrian flow process with a flowchart composed from Pedestrian Library blocks.
We will start with a very simple process: passengers enter the subway station (just where we put the entryLine) and then move to the trains (to our targetLine).
In AnyLogic you create flowcharts by adding the blocks from the library palette to the graphical diagram, setting custom properties for the blocks, and connecting blocks together.
Create the model flowchart
Let's say a pair of words about these flowchart blocks.
Please refer to Pedestrian Library Reference Guide for the detailed information about all Pedestrian Library blocks.
Configure the flowchart blocks
Start the model
OK, great! We have created a simple model just in minutes.
Note that there are several reference models available representing the milestones of the editing. You can use them if you experience any difficulties creating a model and you would like to compare your model with the reference file. Below you can see the link opening the reference model corresponding to this phase.
Reference model: Subway Entrance Hall - Phase 1
If everything is OK, we can continue further. Follow the link at the very end of this page to open the document describing the next phase of the model development.