EnvironmentWithObstacles
Properties
Functions
Add a GlobalReaction to the Environment.
Adds an obstacle to this environment.
The number of dimensions of this environment.
Get the Environment's GlobalReactions.
Given a node, this method returns its neighborhood.
Allows to access a node 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).
Given a Position(center) 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.
Given a node (center) 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 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.
Calculates the position of a node.
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 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
Creates a Position compatible with this environment given its coordinates.
This method moves a node in the environment toward some direction. If node move is unsupported, it does nothing. Subclasses may override this method if they want to change the way a node moves towards some direction. The current implementation internally calls {@link #moveNodeToPosition(Node, Position2D)}, as such, overriding that method may suffice.
This method moves a node in the environment to some position. If node move is unsupported, it does nothing.
This method must calculate the ABSOLUTE next allowed position given the current position and the position in which the node wants to move. For example, if your node is in position 2,3, wants to move to 3,4 but the next allowed position (because, e.g., of physical obstacles) is 2.5,3.5, the result must be a Position containing coordinates 2.5,3.5.
Remove a GlobalReaction from the Environment.
This method allows to remove a node. If node removal is unsupported, it does nothing.
Removes an obstacle from this environment.