Empty Environment
An AbstractEnvironment implementation that intentionally provides no spatial functionality.
This environment is meant as a placeholder or sentinel implementation in contexts where an it.unibo.alchemist.model.Environment instance is required, but node insertion, movement, neighborhood computation, and position construction must be disallowed.
Parameters
the Incarnation associated with this environment.
the number of spatial dimensions exposed by this environment.
Properties
Get the Environment's GlobalReactions.
Return the Incarnation used to initialize the entities of this Environment, if it has been set.
Return true if all the terminators are true.
Returns the current LinkingRule.
Returns the number of Nodes currently in the Environment.
The origin (all zeros) for each coordinate axis.
Return the current Simulation, if present, or throws an IllegalStateException otherwise.
Return the current Simulation, if present, or null otherwise.
The (unit) extent for each coordinate axis.
Override this property if units measuring distance do not match with units used for coordinates. For instance, if your space is non-Euclidean, or if you are using polar coordinates. A notable example is using geographical latitude-longitude as y-x coordinates and meters as distance measure.
Functions
Add a GlobalReaction to the Environment.
Add a terminator indicating whether the simulation should be considered finished.
Adds to the simulation a predicate that determines whether a simulation should be terminated.
Calculates the shortest paths using the Floyd-Warshall algorithm calculating the Hop Distance between nodes.
Computes the diameter of all subnetworks in the environment. The diameter is the longest shortest path between any two nodes. Returns a Map mapping each node to the subnetwork it belongs to.
Computes the diameter of all subnetworks in the environment. The diameter is the longest shortest path between any two nodes, evaluated using the allShortestHopPaths method. Returns a Set containing the subnetworks.
Computes the diameter of all subnetworks in the environment. The diameter is the longest shortest path between any two nodes, evaluated using the allShortestHopPaths method. Returns a Set containing the subnetworks.
Given a node, this method returns its neighborhood.
Allows accessing a Node in this Environment known its id. Depending on the implementation, this method may or may not be optimized (namely, id could run in constant or linear time with the number of nodes).
Given a position this method returns a list of all the surrounding nodes within the given range. Note that this method (depending on the implementation) might be not optimized.
Given a node this method returns a list of all the surrounding nodes within the given range. Note that this method (depending on the implementation) might be not optimized, and it's consequently much better to use Environment.getNeighborhood and filter the neighborhood if you are sure that all the nodes within the range are connected to the center.
Calculates the position of a node.
Returns true the network is segmented, false otherwise.
Given the coordinates of the point, returns a Position compatible with this environment.
This environment cannot create positions.
This environment does not support node movement.
Returns the diameter of the network in environment units if it is not segmented, and NaN otherwise.
Remove a GlobalReaction from the Environment.
Removes node. If node removal is unsupported, it does nothing.
Returns the EnvironmentSubscriptionMonitor of this Environment.
A function that maps an Environment to its surrogate class (EnvironmentSurrogate). Use the toSuitablePositionSurrogate strategy for PositionSurrogate mapping.
A function that maps an Environment to its surrogate class (EnvironmentSurrogate).
Converts an Environment to a EnvironmentSurrogate.