Package-level declarations

Types

Link copied to clipboard
open class BaseNavigationGraph<V : Vector<V>, A : Transformation<V>, N : ConvexShape<V, A>, E>(vertexSupplier: Supplier<N>?, edgeSupplier: Supplier<E>?, graphType: GraphType) : AbstractBaseGraph<N, E> , NavigationGraph<V, A, N, E>

An implementation of NavigationGraph, deriving from AbstractBaseGraph. The user can specify the GraphType so as to obtain a custom graph (e.g. weighted or not, directed or undirected, etc). AbstractBaseGraph guarantees deterministic ordering for the collection it maintains, as stated in its api documentation. Note that vertices and edges are used as keys inside AbstractBaseGraph, so when choosing their types, you must follow these rules:

Link copied to clipboard
class DirectedNavigationGraph<V : Vector<V>, A : Transformation<V>, N : ConvexShape<V, A>, E>(edgeClass: Class<out E>) : BaseNavigationGraph<V, A, N, E>

A directed unweighted BaseNavigationGraph, allowing multiple edges between the same pair of vertices and without self-loops (i.e. edges connecting a node to itself).

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(val tail: ConvexPolygon, val head: ConvexPolygon, val 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

An ExtendableConvexPolygon located inside an environment with obstacles. Obstacles, as well as the environment's boundaries, are taken into account when the polygon is extended (i.e. the polygon is prevented from intersecting an obstacle or growing beyond such boundaries). A rectangular region is assumed, its origin, width and height are to be specified. Both java.awt.Shapes and ConvexPolygons can be specified as obstacles (see awtObstacles and polygonalObstacles). This class is explicitly designed for the algorithm contained in generateNavigationGraph. TODO(improve the quality of this class)

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

A graph used for navigation purposes. Nodes are ConvexShapes, 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).

Link copied to clipboard
object NaviGator

TODO(improve the quality of this algorithm)

Link copied to clipboard
class UndirectedNavigationGraph<V : Vector<V>, A : Transformation<V>, N : ConvexShape<V, A>, E>(edgeClass: Class<out E>) : BaseNavigationGraph<V, A, N, E>

An undirected unweighted BaseNavigationGraph, allowing multiple edges between the same pair of vertices and without self-loops (i.e. edges connecting a node to itself).