InfiniteHalls
An environment made of an infinite grid of halls, each one with a room connected to corridors through doors.
Parameters
the incarnation to be used.
the size of a single hall.
if true, every room has four open accesses, otherwise only two.
Type Parameters
concentration type
Constructors
Properties
The current position of this node, see currentPositionOf.
The number of dimensions of this environment.
Return the Incarnation used to initialize the entities of this Environment, if it has been set.
Whether any of the terminators is satisfied.
Return all the Layers in this Environment.
The observable neighborhood of this node, see neighborhoodOf.
The current NetworkModel, which must be bound to this environment. Assigning a new model publishes the neighborhood it provides for every node in the environment.
Returns an Observable view of the number of Nodes currently in the Environment.
An ordered Observable view of all the Nodes that exist in current Environment.
This method allows to know which are the smallest coordinates represented. Return an array of length dimensions containing the smallest coordinates for each dimension.
Create a position corresponding to the origin of this environment.
The observable position of this node, see positionOf.
The reactions registered with this host, in registration order; ObservableList.current is a snapshot.
A factory of shapes compatible with this environment.
Return the current Simulation, if present, or throws an IllegalStateException otherwise.
Return the current Simulation, if present, or null otherwise.
The size of the environment as an array of length getDimensions(). This method must return distance measured with the same unit used by the positions. No non-euclidean distance metrics are allowed.
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
Registers reaction and notifies the running simulation when it was not already present. Fails if this is not the Reaction.host of reaction.
Add a terminator indicating whether the simulation should be considered finished. The simulation finishes as soon as any of the terminators is satisfied.
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.
Retrieves node's current position.
The distance between this node and other, see distanceBetween.
The farthest position reachable by the node towards the desired one, stopping at the walls of the halls.
Gets the heading of a node as a direction vector.
Gets all nodes whose shape.intersect is true for the given shape.
Gets the shape of a node relatively to its position and heading in the environment.
Returns true the network is segmented, false otherwise.
Given the coordinates of the point, returns a Position compatible with this environment.
Creates a new Euclidean2DPosition.
Creates an euclidean position from the given coordinates.
Moves this node by displacement, relative to its current position, see moveNodeBy.
Moves node by displacement, relative to its current position, through moveNodeTo. Environments constraining movements should override moveNodeTo rather than this function, so that their constraints apply to absolute movements as well.
Moves node to the farthestReachablePosition towards position, extending the environment to include it.
Moves this node to position, see moveNodeTo.
Given a node, this method returns an observable view of its neighborhood.
Returns the diameter of the network in environment units if it is not segmented, and NaN otherwise.
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.neighborhoodOf and filter the neighborhood if you are sure that all the nodes within the range are connected to the center.
The nodes within range of this position, see nodesAround.
The nodes within range of this node, see nodesAround.
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).
Observes the value of the Layer associated with molecule at the position of node. The observable emits when node moves to a position where the value differs, and when the layer changes the value at the current position of node. Its value is null while no layer is associated with molecule, and it emits when one is: observables created during setup follow layers associated later.
An Observable alternative to nodesAround.
Observes the nodes within range of this position, see observeNodesAround.
Observes the nodes within range of this node, see observeNodesAround.
Observe the position of a node.
Removes this node, see removeNode.
Unregisters this reaction from its host, see removeReaction.
Removes node. If node removal is unsupported, it does nothing.
Unregisters reaction and notifies the running simulation when it was actually present.
Sets the heading of a node.
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.
A position with these coordinates, see makePosition.