AnyLogic 9
Expand
Font size

Network

A network is a set of nodes connected by segments. You draw a network when you need network- or layout-based modeling. It is typically used when the processes being modeled take place in a specific physical space and involve the movement of agents and resources. For example, this could be a hospital or a plant logistics process.

You define the network topology by drawing specific space markup elements (nodes and paths), for example, over a facility map used as a background. In the network, a node defines the location where agents can be, while paths connecting nodes define the routes that agents can take when moving from one node to another. Movement is always done along the shortest path between the origin and the destination nodes. Agents and resource units can have individual speeds and these speeds can change dynamically. For example, you can set different speeds for the loaded and the unloaded forklift truck. It is assumed that segments have unlimited capacity and that agents moving along a segment do not interfere with each other.

The  Network element is automatically created when two network elements (a path and a node or two paths) are connected. AnyLogic also automatically creates a network for any path element that is not connected to any other network elements.

You can have multiple networks in one model.

When configuring the Visible, Z, and Show in network properties, remember that all network elements will inherit the values of these properties.

To select a network

  1. Right-click any element that belongs to the network. The element will be selected.
  2. From the context menu, select Select network.

Properties

General

Name — The name of the network. The name is used to identify and access the network from code and flowchart block properties.

Lock — If selected, the network is locked. Locked elements do not respond to mouse clicks, and they cannot be selected in the graphical editor until you unlock them. This is often needed when you want to prevent the element from being edited while other elements are placed over it.

Ignore — If selected, the network is excluded from the model.

Position and size

Level — The level on which this network is located.

Z — The Z-coordinate of the network.

Visibility and presentation

Visible — If selected, the network is visible during animation at model runtime.

Show in — Select whether the shape is displayed in both 2D and 3D animation, 2D only, or 3D only.

Agent presentation — If selected, the network is also visible on the upper-level agent that hosts the agent containing this network.

Functions

Networks provide functions that allow you to add elements to the network with code, calculate routing and line distances, and count the number of different elements that make up the network, see the API documentation for the AbstractNetwork and Network classes.
Note that the functions that modify the network can only be called before the network is initialized.
Function Description
Node getNearestNode(Point givenPoint) Returns the node closest to the provided Point.

givenPoint — the point.
Node getNearestNode(double x, double y, double z, Point out) Returns the node closest to the point with the provided X, Y, and Z coordinates.

x, y, z — the X, Y, and Z coordinates of the point.
out — The output point. The function itself returns the node, and in out you can store the coordinates of the point in this node that will be closest to the given coordinates.
Node getNearestNode(Point p, Point out) Returns the node closest to the provided Point.

givenPoint — the point.
out — The output point. The function itself returns the node, and in out you can store the coordinates of the point in this node that will be closest to the given coordinates.
Node getNearestNode(Agent agent, Point out) Returns the node closest to the specified agent.

agent — the agent.
out — The output point. The function itself returns the node, and in out you can store the coordinates of the point in this node that will be closest to the given coordinates.
Agent getSpace() Returns the agent where this network is defined.
double getZ() Returns the network’s Z-coordinate. The Z-coordinates of the elements belonging to this network are relative to the Z of the network.
Level getLevel() Returns the level on which this network is located.
How can we improve this article?