Paths and nodes are space markup elements that define the locations of agents in the space:
Nodes can be connected with paths. Altogether they compose a
network.
AnyLogic also automatically creates a separate network for every single
path element that is not connected to any nodes. In the network, a node
defines a place where agents may stay, while paths connecting nodes
define the routes that agents may take when moving from one node to
another. Movement is always performed along the shortest path between
the origin and the destination nodes. Agents and resource units may
have individual speeds, moreover, those speeds may change dynamically.
For example, you can set different speed for the loaded and the
unloaded forklift truck. It is assumed that segments have unlimited
capacity, so agents moving along a segment do not interfere.
You can select a path as Agent location in the following Process Modeling Library blocks' properties: Delay, Queue, Match, Combine, Seize, Service, Conveyor, Batch, RackStore .
Path may contain any number of linear and/or curved segments.
To draw a path
You can continue drawing the path after you finished it with the double-click, and edit the path by making segments linear or curved.
Name – The name of the path. The name is used to identify and access the path from code and flowchart blocks properties.
Ignore – If selected, the path is excluded from the model.
Visible on upper agent
– If selected, the path is also visible on the upper agent where this agent lives.
Lock
– If selected, the path is
locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them.
Visible – Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.
Bidirectional - Here you can enable movement on the path in both directions.
Speed limit for transporters - If selected, limits the speed of transporters on this path to the specified level.
Limit number of transporters - If selected, limits the overall number of transporters on this path.
Type
– The type of the path. Choose between
Dashed line,
Line,
Road,
Railroad
or
Conveyor.
|
|
|
Road |
Railroad |
Conveyor |
Note that by setting
Type
to
Road,
Railroad
or
Conveyor
you only change the visual appearance of the path. It does not add any
specifics to the path logic. Typically you use such paths in the models
with high abstraction level only.
For road traffic simulation, use
Road Traffic Library
and
road traffic markup shapes
(road, intersection, etc.).
For low-level railway simulation (considering every single railway track of the simulated rail yard), use
Rail Library
and
rail markup shapes.
For bulk transportation simulation, use
Fluid Library
and
Bulk conveyor belt
markup shape.
Line color – The path color if the type is Dashed line or Line.
Line width – The width of the path if the type is Dashed line or Line.
Width – The width of the path when its type is set to Road, Railroad or Conveyor.
X – X-coordinate of the path's start point.
Y – Y-coordinate of the path's start point.
Z – [Enabled if Show in: 2D and 3D or 3D only options are selected] Z-coordinate of the path's start point.
The table located in the Points property section enables users to view and adjust coordinates of the path turning points.
Here
you define relative coordinates, not the absolute ones. The first point
always has coordinates (0, 0, 0) that can not be changed.
Other
rows of the table define relative coordinates of the successive points.
Coordinates of each point are actually offsets of the corresponding
point from the start point along X, Y (and optionally Z) axes
correspondingly.
Show in - Here you can choose whether you want the shape to be shown both in 2D and 3D animation, or in 2D only, or in 3D only.
Show name – If selected, the path's name is displayed on the graphical diagram.
Function |
Description |
double length() |
Returns the length of the path (in pixels) calculated in 3D space. |
double length(LengthUnits units) |
Returns the length of the path calculated in 3D space. Parameter: units - one of the chosen length units. |
Function |
Description |
Point getStartPoint() |
Returns the Point object with coordinates of the path's starting point. |
Point getStartPoint(Point out) |
Returns the Point object with coordinates of the path's starting point.
Parameter: |
Point getEndPoint() |
Returns the Point object with coordinates of the path's ending point. |
Point getEndPoint(Point out) |
Returns the Point object with coordinates of the path's ending point.
Parameter: |
Position getStartPosition() |
Returns the Position object with coordinates and orientation of the path's starting point. |
Position getStartPosition(Position out) |
Returns the Position object with coordinates and orientation of the path's starting point.
Parameter: |
Position getEndPosition() |
Returns the Position object with coordinates and orientation of the path's ending point. |
Position getEndPosition(Position out) |
Returns the Position object with coordinates and orientation of the path's ending point.
Parameter: |
boolean contains(double px, double py) |
Returns true if the path contains the point with the given coordinates; returns false otherwise.
Parameters: |
boolean contains(double px, double py, double distance) |
Returns true if the path contains the point with the given coordinates using the given distance tolerance; returns false otherwise.
Parameters: |
boolean containsSq(double px, double py, double squareDistance) |
Returns true if the path contains the point with the given coordinates using the given square distance tolerance; returns false otherwise.
Parameters: Returns: true if the shape contains the point with the given coordinates. |
double getNearestPoint(double x, double y, Point out) |
Calculates the point in this path nearest to the given (x, y) point and writes the result to the output Point object. Returns the square of the distance to the point. All calculations are performed in the horizontal XY-projection (i.e. z-coordinates are treated as zeros).
Parameters: |
double getNearestPoint(double x, double y, double z, Point out) |
Calculates the point in this path nearest to the given (x, y, z) point and writes the result to the output Point object. Returns the square of the distance to the point.
Parameters: |
Position getPositionAtOffset(double offset, Position out) |
Returns the Position object with coordinates and orientation of the point that is located at the given offset distance (in pixels) from the path's starting point.
Parameters: |
Position getPositionAtOffset(double offset, LengthUnits units, Position out) |
Returns the Position object with coordinates and orientation of the point that is located at the given offset distance from the path's starting point.
Parameters: |
Function |
Description |
int getSegmentCount() |
Returns the number of the path's segments. |
MarkupSegment getSegment(int index) |
Returns the segment by the provided index.
Parameter: |
Function |
Description |
Node getSource() |
Returns the path's source node. |
Node getTarget() |
Returns the path's target node. |
Function |
Description |
boolean isVisible() |
Returns true if the path is visible; returns false otherwise. |
void setVisible(boolean v) |
Sets the visibility of the path.
Parameter: |
Function |
Description |
Color getLineColor() |
Returns the color of the path, or null if the path has no color or uses a texture (in this case use getLineTexture() to get the path's texture). |
Texture getLineTexture() |
Returns the texture of the path or null if the path has no texture but uses a color (in this case use getColor() to get the path's color). |
void setLineColor(Color color) |
Sets the color of the path.
Parameter: |
void setLineColor(Paint color) |
Sets the
color
(or texture) of the path. |
Function |
Description |
double getLineWidth() |
Returns the width of the path outline (in pixels). |
double getLineWidth(LengthUnits units) |
Returns the width of the path outline.
Parameter: |
void setLineWidth(double width) |
Sets the width of the path outline;
0
means the thinnest possible outline. |
void setLineWidth(double width, LengthUnits units) |
Sets the width of the path outline;
0
means the thinnest possible outline. |
Function |
Description |
void remove() |
Removes the path from the presentation. If the path is not a part of presentation, the function does nothing. |
Each path has a direction - the first point you draw is treated as the starting point of the path.
When a path animates some
Process Modeling Library
object (Queue,
Conveyor, etc.), it is important where you place the starting point of the path as:
To change the direction of the path
To add a segment to the path
Several paths can be connected together, with or without the use of nodes. You can disconnect the paths too.
To connect two or more paths into one path
To connect two or more paths with a point node
You can split the paths that are connected at the point node or split one whole path into several paths by segments.
To disconnect the paths or segments