AnyLogic
Expand
Font size

AnyLogic class reference

All elements of agents (except for connectors and all types of statechart states) can be accessed from code simply by their names.

Almost all AnyLogic elements are represented as instances of Java classes, having their own methods and data fields.

Here you can find references to the classes that AnyLogic generates for its elements.

To obtain information about functions of an AnyLogic element

  1. In this article, expand the required palette’s description by clicking its name in the section below.
  2. Find the element in the table. The name of the corresponding Java class is given in the right column. Click the link to open Javadoc help on this class. If it is said that the class is inherited from some base class or classes, all methods of that base class or classes are available to you too.

Palette elements

Process Modeling Library

Refer to the Process Modeling Library Reference Guide for details.

Material Handling Library

Refer to the Material Handling Library Reference Guide for details.

Pedestrian Library

Refer to the Pedestrian Library Reference Guide for details.

Rail Library

Refer to the Rail Library Reference Guide for details.

Road Traffic Library

Refer to the Road Traffic Library Reference Guide for details.

Fluid Library

Refer to the Fluid Library Reference Guide for details.

System Dynamics
Element Class
Stock In case the variable is not declared as an array, it is represented in AnyLogic as a primitive variable that you can only access and modify. In case it is declared as an array, it is represented as an instance of HyperArray class.
Flow
Dynamic variable
Link Link is a simple graphical element that does not provide API.
Parameter You choose the type/class of the parameter by yourself in the Type property of the parameter. You can make your parameter an instance of any primitive Java type (int, double, boolean, etc.), or of any Java class you like (String, Date, Color, HyperArray (the class of the parameter declared as an array) and any other).
Table Function TableFunction
Loop Loop is a simple graphical element that does not provide API.
Connector You cannot access connectors from code.
Agent
Element Class
Agent You define agent types by yourself, so that they get the names you define for them. All agent types inherit from the base class of agents: Agent.
Parameter You choose the type/class of the parameter by yourself in the Type property of the parameter. You can make your parameter an instance of any primitive Java type (int, double, boolean, etc.), or of any Java class you like (String, Date, Color, HyperArray (the class of the parameter declared as an array) and any other).
Event Class of the event depends on its Trigger type: All these classes are inherited from the base class Event.
Dynamic Event AnyLogic creates Java class with the name you specify for the dynamic event. All dynamic events that will be created and scheduled during the simulation will be are instances of this class.
Variable You choose the type/class of the variable by yourself in the Type property of the variable. You can make your variable instance of any primitive Java type (int, double, boolean, etc.), or of any Java class you like.
Collection The type is defined by the user in the Collection class property of the collection. The most commonly used collection classes are ArrayList and LinkedList.

Function

You can only call the function by typing its name followed by parentheses. In the case function has some arguments, you should pass argument values separated by commas inside the parentheses. Arguments should be provided in the same order they are defined in the Function arguments table.
Table Function TableFunction
Schedule Schedule
Port The base class for all ports in AnyLogic is Port. However, you can define your own port classes with custom functionality. In this case you should make them inherit from Port class.
Connector You cannot access connectors from code.
Link to agents Link to agent implements LinkToAgent interface.
Statechart You can access statechart by the name of its statechart entry point. It is an instance of the class Statechart. You can also access transitions programmatically. Class of the transition depends on its trigger type: All these classes are inherited from the base class Transition. States, final states, branches, and history states cannot be accessed from code.
Presentation

AnyLogic presentation shapes are instances of the corresponding classes listed in the table below. All these classes are inherited from the base class Shape. It contains methods allowing user to change shape's position, visibility, scale, and rotation angle.

Element Class
Line ShapeLine
Polyline ShapePolyLine
Curve ShapeCurve
Rectangle ShapeRectangle
Rounded Rectangle ShapeRoundedRectangle
Oval ShapeOval
Arc ShapeArc
Text ShapeText
Image ShapeImage
Canvas ShapeCanvas
Group ShapeGroup
View Area ViewArea
CAD Drawing ShapeCAD
3D Window ShapeWindow3D
3D Object Shape3DObject
Camera Camera3D
Light Class of the light depends on its Light type: All these classes are inherited from the base class Light3D.
Space Markup
Element Class
Path Path
Rectangular Node RectangularNode
Polygonal Node PolygonalNode
Point Node PointNode
Attractor Attractor
Pallet Rack PalletRack
GIS
GIS Map ShapeGISMap
GIS Point GISPoint
GIS Route GISRoute
GIS Region GISRegion
Route Provider Implements interface IGISRouteProvider
Material Handling
Conveyor ConveyorPath
Conveyor spur ConveyorSpur
Position on Conveyor PositionOnConveyor
Transfer Table ConveyorTransferTable
Turntable ConveyorTurntable
Turn Station ConveyorTurnStation
Station ConveyorStation
Custom Station ConveyorCustomStation
Jib Crane JibCrane
Overhead Crane OverheadCrane
Storage Storage
Lift Lift
Network Port NetworkPort
Level Gate LevelGate
Density Map DensityMap
Pedestrian
Wall Wall
Rectangular Wall RectangularWall
Circular Wall CircularWall
Target Line TargetLine
Service with Lines ServiceWLine

Consists of service points (ServicePoint) and queue lines (QueuePath)

Service with Area ServiceWArea

Consists of service points (ServicePoint) and waiting area (QueueArea)

Escalator Group EscalatorGroup

Consists of escalators (Escalator)

Elevator Elevator
Pathway Pathway
Ped Flow Statistics PedFlowStatistics
Density Map

DensityMap

Rail
Railway Track RailwayTrack
Position on Track PositionOnTrack
Road
Road Road
Intersection Intersection
Stop Line StopLine
Bus Stop BusStop
Parking Lot ParkingLot
Fluid
Storage Tank StorageTank
Pipe Pipe
Bulk Conveyor Belt BulkConveyorBelt
Analysis
Element Class
Data Set DataSet
Statistics The class of the statistics element depends on the type of statistics:
Histogram Data Histogram data element is represented in AnyLogic with instance of on of the following classes:
  • HistogramSimpleData — Data of a histogram with a fixed minimum, maximum, and number of intervals.
  • HistogramSmartData — Data of a histogram with a fixed number of intervals but auto-adjustable data range.
Both classes are inherited from the base class HistogramData.
Histogram2D Data Histogram2DData
Bar Chart BarChart
Stack chart StackChart
Pie Chart PieChart
Plot Plot
Time Plot TimePlot
Time Stack Chart TimeStackChart
Time Color Chart TimeColorChart
Histogram Histogram
Histogram 2D Histogram2D
Controls

AnyLogic controls are instances of the corresponding classes listed in the table below. All these classes are inherited from the base class ShapeControl that in turn inherits from the class Shape. Shape contains methods allowing user to change control's position, visibility, scale, and rotation angle.

Element Class
Button ShapeButton
Check Box ShapeCheckBox
Edit Box ShapeTextField
Radio Buttons ShapeRadioButtonGroup
Slider ShapeSlider
Combo Box ShapeComboBox
List Box ShapeListBox
File Chooser ShapeFileChooser
Progress Bar ShapeProgressBar
Statechart

You can access statechart by the name of its statechart entry point. It is an instance of the class Statechart. You can also access transitions programmatically. Class of the transition depends on its trigger type:

All these classes are inherited from the base class Transition. States, final states, branches, and history states cannot be accessed from code.
Connectivity
Element Class
Excel File ExcelFile
Text File TextFile
Database Database
Query Query
Key-Value Table KeyValueTable
Insert Insert
Update Update
Pictures

All pictures are in fact groups of standard AnyLogic shapes and are instances of class ShapeGroup.

3D Objects

All 3D objects distributed with AnyLogic are in fact common AnyLogic 3D objects and are instances of class Shape3DObject. Fork Lift Truck and Pallet Trolley are groups (instances of class ShapeGroup), containing a couple of 3D objects - a man and a forklift/pallet trolley correspondingly. You can ungroup them and use these 3D objects individually.

Experiments

Class of the experiment depends on its type:

All these classes are inherited from the base class Experiment.

How can we improve this article?