Package it.unibo.alchemist.model.implementations.actions

Types

Link copied to clipboard
abstract class AbstractGroupSteeringAction<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>) : AbstractSteeringAction<T, P, A> , GroupSteeringAction<T, P>

An abstract GroupSteeringAction.

Link copied to clipboard
abstract class AbstractLayerAction(    environment: Euclidean2DEnvironment<Number>,     reaction: Reaction<Number>,     pedestrian: PedestrianProperty<Number>,     targetMolecule: Molecule) : AbstractSteeringAction<Number, Euclidean2DPosition, Euclidean2DTransformation>

Abstract implementation of an action influenced by the concentration of a given molecule in the environment.

Link copied to clipboard
abstract class AbstractNavigationAction<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>, L : ConvexGeometricShape<P, A>, R, N : ConvexGeometricShape<P, A>, E>(    val environment: EnvironmentWithGraph<*, T, P, A, N, E>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>) : AbstractSteeringAction<T, P, A> , NavigationAction<T, P, A, L, R, N, E>

An abstract NavigationAction, taking care of properly moving the node in the environment while delegating the decision on where to move it to a NavigationStrategy.

Link copied to clipboard
abstract class AbstractSteeringAction<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>) : AbstractMoveNode<T, P> , SteeringAction<T, P>

A SteeringAction in a vector space. The implementation of nextPosition is left to subclasses.

Link copied to clipboard
abstract class AbstractSteeringActionWithTarget<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     targetSelectionStrategy: TargetSelectionStrategy<T, P>) : AbstractSteeringAction<T, P, A> , SteeringActionWithTarget<T, P>

A SteeringActionWithTarget in a vector space.

Link copied to clipboard
open class CognitiveAgentArrive<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     decelerationRadius: Double,     arrivalTolerance: Double,     target: P) : AbstractSteeringActionWithTarget<T, P, A>

Move the agent towards a target position. It is similar to CognitiveAgentSeek but attempts to arrive at the target position with a zero velocity.

Link copied to clipboard
class CognitiveAgentAvoidLayer @JvmOverloads constructor(    environment: Euclidean2DEnvironment<Number>,     reaction: Reaction<Number>,     pedestrian: PedestrianProperty<Number>,     targetMolecule: Molecule,     viewDepth: Double = Double.POSITIVE_INFINITY) : AbstractLayerAction

Move the node towards positions of the environment with a low concentration of the target molecule.

Link copied to clipboard
class CognitiveAgentCohesion<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>) : AbstractGroupSteeringAction<T, P, A>

Move the agent towards the other members of his group.

Link copied to clipboard
class CognitiveAgentCombineSteering<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     actions: List<SteeringAction<T, P>>,     steerStrategy: SteeringStrategy<T, P>) : AbstractSteeringAction<T, P, A>

Combination of multiple steering actions.

Link copied to clipboard
class CognitiveAgentExplore<T, L : Euclidean2DConvexShape, R>(    environment: Euclidean2DEnvironmentWithGraph<*, T, ConvexPolygon, Euclidean2DPassage>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>) : CognitiveAgentNavigationAction2D<T, L, R>

A NavigationAction using Exploring navigation strategy.

Link copied to clipboard
open class CognitiveAgentFlee<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     coords: Double) : AbstractSteeringAction<T, P, A>

Move the agent away from a target position. It's the opposite of CognitiveAgentSeek.

Link copied to clipboard
open class CognitiveAgentFollowLayer(    euclidean: Euclidean2DEnvironment<Number>,     reaction: Reaction<Number>,     pedestrian: PedestrianProperty<Number>,     targetMolecule: Molecule) : AbstractLayerAction

Move the node towards positions of the environment with a high concentration of the target molecule.

Link copied to clipboard
class CognitiveAgentFollowRoute<T, L : Euclidean2DConvexShape, R>(    environment: Euclidean2DEnvironmentWithGraph<*, T, ConvexPolygon, Euclidean2DPassage>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     route: Number) : CognitiveAgentNavigationAction2D<T, L, R>

A NavigationAction using RouteFollowing navigation strategy.

Link copied to clipboard
class CognitiveAgentFollowScalarField<T, P : Position2D<P>, Vector2D<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     center: P? = null,     valueIn: (P) -> Double) : AbstractSteeringAction<T, P, A>

Moves the node where the given scalar field is higher.

Link copied to clipboard
class CognitiveAgentGoalOrientedExplore<T, L : Euclidean2DConvexShape, R>(    environment: Euclidean2DEnvironmentWithGraph<*, T, ConvexPolygon, Euclidean2DPassage>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     unknownDestinations: Number) : CognitiveAgentNavigationAction2D<T, L, R>

A NavigationAction using GoalOrientedExploring navigation strategy.

Link copied to clipboard
open class CognitiveAgentNavigationAction2D<T, L : Euclidean2DConvexShape, R>(    val environment: Euclidean2DEnvironmentWithGraph<*, T, ConvexPolygon, Euclidean2DPassage>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     wallRepulsionFactor: Double = DEFAULT_WALL_REPULSION_FACTOR) : AbstractNavigationAction<T, Euclidean2DPosition, Euclidean2DTransformation, L, R, ConvexPolygon, Euclidean2DPassage>

Implementation of a NavigationAction2D. This action accepts an Euclidean2DEnvironmentWithGraph whose graph contains ConvexPolygonal nodes and Euclidean2DPassages as edges.

Link copied to clipboard
class CognitiveAgentObstacleAvoidance<W : Obstacle2D<Euclidean2DPosition>, T>(    environment: Environment2DWithObstacles<W, T>,     reaction: SteeringBehavior<T>,     pedestrian: PedestrianProperty<T>,     proximityRange: Double) : AbstractSteeringAction<T, Euclidean2DPosition, Euclidean2DTransformation>

Move the agent avoiding potential obstacles in its path.

Link copied to clipboard
class CognitiveAgentPursue<T, L : Euclidean2DConvexShape, R>(    environment: Euclidean2DEnvironmentWithGraph<*, T, ConvexPolygon, Euclidean2DPassage>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     destination: Number) : CognitiveAgentNavigationAction2D<T, L, R>

A NavigationAction using Pursuing navigation strategy.

Link copied to clipboard
class CognitiveAgentReachDestination<T, L : Euclidean2DConvexShape, R>(    environment: Euclidean2DEnvironmentWithGraph<*, T, ConvexPolygon, Euclidean2DPassage>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     destinations: Number) : CognitiveAgentNavigationAction2D<T, L, R>

A NavigationAction using DestinationReaching navigation strategy. Accepts an array of coordinates representing the destinations and uses inferIsKnown to partition them into known and unknown ones.

Link copied to clipboard
class CognitiveAgentReachKnownDestination<T, L : Euclidean2DConvexShape, R>(    environment: Euclidean2DEnvironmentWithGraph<*, T, ConvexPolygon, Euclidean2DPassage>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     destinations: Number) : CognitiveAgentNavigationAction2D<T, L, R>

A NavigationAction using KnownDestinationReaching navigation strategy.

Link copied to clipboard
open class CognitiveAgentSeek<T, P : Position<P>, Vector<P>, A : GeometricTransformation<P>>(    environment: Environment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     target: P) : CognitiveAgentArrive<T, P, A>

Move the node towards the target position as fast as possible.

Link copied to clipboard
open class CognitiveAgentSeek2D<T, P : Position2D<P>, Vector2D<P>, A : GeometricTransformation<P>>(    environment: EuclideanEnvironment<T, P>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     target: P) : AbstractSteeringAction<T, P, A> , SteeringActionWithTarget<T, P>

CognitiveAgentSeek behavior in a bidimensional environment, delegated to CognitiveAgentFollowScalarField (this means the node tries to overtake others on its path, in general its movements are more sophisticated than CognitiveAgentSeek).

Link copied to clipboard
class CognitiveAgentSeparation<T>(    val environment: Physics2DEnvironment<T>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>) : AbstractGroupSteeringAction<T, Euclidean2DPosition, Euclidean2DTransformation>

Move the agent away from the pedestrians near to him.

Link copied to clipboard
open class CognitiveAgentWander<T>(    environment: Physics2DEnvironment<T>,     reaction: Reaction<T>,     pedestrian: PedestrianProperty<T>,     randomGenerator: RandomGenerator,     offset: Double,     radius: Double) : AbstractSteeringActionWithTarget<T, Euclidean2DPosition, Euclidean2DTransformation>

Give the impression of a random walk through the environment targeting an ever changing pseudo-randomly point of a circumference at a given distance and with a given radius from the current node position.

Functions

Link copied to clipboard
fun <T> Sequence<T>.cartesianProduct(other: Sequence<T>): Sequence<Pair<T, T>>

Performs the cartesian product of two sequences.

Link copied to clipboard
fun <T> List<T>.takePercentage(percentage: Double): List<T>

Takes the first percentage * size elements of the list.

Link copied to clipboard
fun <P : Position<P>> Array<out Number>.toPositions(environment: Environment<*, P>): List<P>

Converts an array of numbers representing positions to an actual list of positions. E.g. the array 2,3,4,5 in a bidimensional environment would be transformed into a list containing positions (2,3) and (4,5).