Creating Model Animation
the flowchart is animated, you may want to see the actual bank
department layout animated. That is also possible! For each model you
can create an animation to visually represent your model. You can
create any animation you want. Now we will draw the layout
consisting of the ATM and a queue. Then we will animate
standing in the queue and using the ATM. We also want to
the current status of the ATM.
we will draw the layout of our bank. You draw the layout on the same
diagram where you draw a flowchart. However, if you have existing image
of the layout, you can simply import this picture as the bank layout
instead of drawing it by yourself.
Adding space markup shapes
up space markup for the ATM
- Draw the ATM as a
First, open the Space
palette in the Palette
- Drag the element Point
node from the Space Markup
palette into the graphical editor and place it under the flowchart.
- Select the point node in the
graphical editor to open its Properties
view. Enter the run-time color expression for the shape in the Color property: ATM.size()> 0 ? red : green
Note that ATM here is the name of the Delay block
we created. The expression determines the point node color at run time. The size()
function returns the number of agents currently being processed. The
color will be red, if a customer is served at this time, and green
- Click the delay
in the flowchart to open its Properties
- Select the point
we have drawn in the Agent
option. You can either click the down arrow and select the point node
from the list of appropriate space markup elements, or you can click the button,
located on the right, to select this space markup shape from the
graphical editor (the rest of the elements in the editor will be greyed
up space markup for the queue
- Draw the queue as a
open the Space
in the Palette
- Double-click the
to switch to the drawing
- Click in the graphical
editor to put the first point of the path.
Do more clicks to add turning points. Finish drawing with a
- Click the queue block
in the flowchart and go to its Properties
- Select the path
drawn in the Agent
option. You can either click the down arrow
and select the path from the list of appropriate elements, or you
can click the button, located on the right, to select this space markup
shape from the graphical editor (the rest of the elements in the editor
will be greyed out).
you can run the model and observe its behavior. If you want to
speed up the simulation significantly, switch to virtual time
by clicking the Run
as fast as possible (virtual time mode) control. Switching
to virtual time mode allows you to view simulation run at its maximum
speed. Therefore, you can simulate a long period of time.
Adding 3D animation
Both of the elements we have
drawn by default are shown in 2D and
3D. You can check this property in the
Advanced section of their
properties view. Now we want to
create 3D animation for our model.
of all you should add 3D
on the diagram of your agent type.
window plays the
role of a placeholder for 3D animation. It defines the area on the
presentation diagram where 3D animation will be shown at runtime.
Add 3D window
- Drag the 3D Window element from
the 3D section of the Presentation palette to
the graphical editor.
- The grey area will appear on the screen. Locate it
where you want your 3D presentation to be shown at the model runtime:
Navigating through 3D animation
Now you can run your model and
observe simple 3D animation.
When you create a 3D window, AnyLogic adds a view area
that allows you to easily navigate to the 3D view at runtime. To switch
to this 3D view while the model is running, open the developer panel by clicking
the Developer panel control in the right corner of
the control panel. In
the developer panel, expand the select
view area to navigate list and select [window3d] from the list.
through the 3D scene using the commands described below:
mouse like described here
Move the scene
Press the left mouse button in the 3D view and hold the mouse
2. Move the mouse in the required direction.
Rotate the scene
Press Alt key
(Mac OS: Option key) and hold it pressed.
2. Click in the 3D scene window and, while holding Alt and
the left mouse button down.
3. Move the mouse in the required rotation direction.
Zoom in/out the scene
Scroll the mouse wheel in the
3D window away from / towards you.
Adding 3D objects
Now we want to add a customer
figure. By default the customers are
drawn as coloured dots and shown as colored cylinders in 3D
animation. We want to create our custom type of client and animate it
in 3D. We will create a new agent
type for this purpose.
Create a new agent type
- Open the Process
- Drag the element Agent Type
into the graphical
- The New agent
wizard will open on the Creating
new agent type
step. Enter Customer
as the Agent
type name, and leave the Create the agent type "from
scratch" selected. Press Next.
- In the next step select
as the animation type and select Person
from the list of the 3D figures.
- Click Finish.
The new Customer diagram
will open. You can find the Person 3D
figure in the axis origin. Switch back to the Main
Configure flowchart to use the new type
- On the Main
diagram, select the block source
in the graphical editor.
- Choose Customer
in the New agent drop-down
- Go to the Properties
view of the point node element and set Visible
control to no. This way the
markup shape will be invisible during animation on model runtime.
Repeat this action for path element.
- Run the model and switch to
3D view to see our customers moving in the queue.
Add an ATM figure
- Open the 3D
palette in the Palette
- Drag the ATM
3D figure from the Supermarket
section of this palette onto the point node shape in the graphical
- If you run the model now and
check 3D animation in window3D mode,
you will notice that our ATM does not face the customers' flow and we
need to rotate it.
- Select the atm
3D object in the graphical editor and open the section Position
in its properties view.
- Choose 0 degrees
from the drop-down list of the
- Run the model to
that the ATM is facing the customers now.
Phase 1, Creating a