In AnyLogic agent plays a role of an environment for the agent populations present on its diagram. So environments can be hierarchically organized (for example, agents-companies can live in one environment and agents-employees can live in local company environments). Agent population can belong to at most one environment.
To set the environment for an agent population
- Open the properties of the agent type playing a role of environment for the agent population by clicking it in the Projects view (e.g. Main).
- In the Space and network section of the properties, select the populations in the list Select the agents you want to place in the environment.
- In the properties below, configure the space type for the environment and set the space dimensions.
- Optionally, choose the pattern of the initial agent location layout and choose one of the connection network types.
Function | Description |
---|---|
NetworkType getNetworkType() | Returns the network type. Valid values: NETWORK_USER_DEFINED NETWORK_RANDOM NETWORK_ALL_IN_RANGE NETWORK_RING_LATTICE NETWORK_SMALL_WORLD NETWORK_SCALE_FREE |
double getNetworkConnectionRange() | Returns the agent connection range — parameter of the “distance-based” network. In this network, all the agents located in the connection range (in pixels), are connected. |
double getNetworkConnectionsPerAgent() | Returns the average (or exact) number of connections per agent. Applies to random, ring lattice and small world networks. |
double getNetworkNeighborLinkProbability() | Returns the probability of an agent connection to be a neighbor. Applies to “small world” network. |
int getNetworkScaleFreeM() | Returns the M parameter of a scale free network. Applies to “scale free” network. |
void setNetworkRandom(double connectionsPerAgent) | Sets network type to random with a given average number of connections per agent. Call applyNetwork() to actually create network connections. connectionsPerAgent — average number of connections per agent |
void setNetworkRingLattice(int connectionsPerAgent) | Sets network type to ring lattice. All agents are considered to be in a ring in their natural order and each agent is connected to a given number of closest neighbors. Call applyNetwork() to actually create network connections. connectionsPerAgent — number of connections per agent (even) |
void setNetworkScaleFree(int m) | Sets the network type to "scale free". m - parameter of the scale free network (start number of hubs) |
void setNetworkSmallWorld(int connectionsPerAgent, double neighborLinkProbability) | Sets network type to "small world". Small world network can be obtained from a ring lattice by rewiring some links to long-distant links. Call applyNetwork() to actually create network connections. connectionsPerAgent - number of connections per agent (even) neighborLinkProbability - probability of connection to link neighbors |
void setNetworkUserDefined() | Sets network type to user-defined. As a result, a subsequent call of applyNetwork() will do nothing. This is also a default network type. |
void setNetworkAllInRange(double connectionRange) | Sets network type to the one when agents are connected if the distance between them is not longer that a given one. This network type is only possible in continuous space. Call applyNetwork() to actually create network connections. connectionRange - the maximum distance between connected agents. In case of GIS space, measured in meters |
void applyNetwork() | Discards all existing connections and establishes new connection network according to the current network settings. |
void applyNetwork(Random r) | Discards all existing connections and establishes new connection network according to the current network settings, using the specified random number generator. r - the random number generator |
-
How can we improve this article?
-