Bio Rect2DEnvironment
Constructors
Properties
Functions
Add a GlobalReaction to the Environment.
Add a terminator indicating whether the simulation should be considered finished.
Computes the farthest position reachable by a node towards a desiredPosition, avoiding node overlapping. If no node is located in between, desiredPosition is returned. Otherwise, the first position where the node collides with someone else is returned. For collision purposes, hitboxes are used: each node is given a circular hitbox of radius equal to its shape's radius (shapeless nodes can't cause overlapping). The client can specify a different radius for the hitbox of the moving node.
Computes the farthest position reachable by a node towards a desiredPosition, avoiding node overlapping. If no node is located in between, desiredPosition is returned. Otherwise, the first position where the node collides with someone else is returned. For collision purposes, hitboxes are used: each node is given a circular hitbox of radius equal to its shape's radius (shapeless nodes can't cause overlapping). The client can specify a different radius for the hitbox of the moving node.
The number of dimensions of this environment.
Get the Environment's GlobalReactions.
Gets the heading of a node as a direction vector.
Return the Incarnation used to initialize the entities of this Environment, if it has been set.
Return all the Layers in this Environment.
Returns the current LinkingRule.
Allows to access a Node in this Environment known its id. Depending on the implementation, this method may or not be optimized (namely, id could run in constant or linear time with the number of nodes).
Returns the number of Nodes currently in the Environment.
Returns all the Nodes that exist in current Environment.
Gets all nodes whose shape.intersect is true for the given shape.
Given a node this method returns a list of all the surroundings 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.
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.
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.
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.
This method returns the size of the environment as an array of length .getDimensions. This method must return distance measured with the same unit used for measuring distances. It may or may not return the same result of .getSize.
Return true if all the terminators are true.
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 the node to the farthestPositionReachable towards the desired newPosition. If the node is shapeless, it is simply moved to newPosition.
Returns a random element of the Iterable using the provided randomGenerator.
Remove a GlobalReaction from the Environment.
Sets the heading of a node.
Returns the current LinkingRule.
Return the current Simulation, if present, or throws an IllegalStateException otherwise.
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.