Package it.unibo.alchemist.model.interfaces.geometry.euclidean2d.graph

Types

Link copied to clipboard

A NavigationGraph in an euclidean bidimensional space. Nodes are ConvexPolygons and edges are Euclidean2DPassages. Using Euclidean2DPassages as edges leads to some overhead (as these store the nodes they connect, when this information is already stored in the navigation graph), but allows to have duplicate edges in opposite directions, which means a node n1 can be connected to another node n2 through a passage whose shape is equal to the one of the passage connecting n2 to n1. The two passages would not result equal because their tail and head would be swapped. On the contrary, if edges were plain segments, the graph would not have allowed to have two edges so that e1.equal(e2).

Link copied to clipboard
data class Euclidean2DPassage(tail: ConvexPolygon, head: ConvexPolygon, passageShapeOnTail: Segment2D<Euclidean2DPosition>)

Defines a passage between two ConvexPolygons in an euclidean bidimensional space. The passage is oriented, which means it connects tail to head, but the opposite is not necessarily true. tail and head can be non-adjacent (there can be some distance between them), this introduces navigation issues as agents may not know which direction to follow when crossing a passage. passageShapeOnTail is a Segment2D representing the shape of the passage on tail's boundary (e.g. in indoor environments, the segment should represent the shape of the door between two rooms). passageShapeOnTail must be determined so as to guarantee that head is reachable by throwing a ray from any point of the segment in its normal direction. This solves navigation issues as it provides agents with a direction to follow when crossing Euclidean2DPassages (namely, the normal direction to passageShapeOnTail).

Link copied to clipboard
interface NavigationGraph<V : Vector<V>, A : GeometricTransformation<V>, N : ConvexGeometricShape<V, A>, E> : Graph<N, E>

A graph used for navigation purposes. Nodes are ConvexGeometricShapes, usually representing portions of an environment which are traversable by agents (the advantage of such representation is that agents can freely walk around within a convex area, as it is guaranteed that no obstacle will be found). Note that implementations of this graph must guarantee predictable ordering for the collections they maintain, as reproducibility is a key feature of Alchemist. Be also aware that, by contract, the org.jgrapht.Graph interface does not allow duplicated edges (see org.jgrapht.Graph.addEdge).