it.unibo.alchemist.model.cognitive.actions.CognitiveAgentReachKnownDestination.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alchemist-cognitive-agents Show documentation
Show all versions of alchemist-cognitive-agents Show documentation
Abstraction for group of pedestrians capable of influence each other emotionally.
/*
* Copyright (C) 2010-2023, Danilo Pianini and contributors
* listed, for each module, in the respective subproject's build.gradle.kts file.
*
* This file is part of Alchemist, and is distributed under the terms of the
* GNU General Public License, with a linking exception,
* as described in the file LICENSE in the Alchemist distribution's top directory.
*/
package it.unibo.alchemist.model.cognitive.actions
import it.unibo.alchemist.model.Reaction
import it.unibo.alchemist.model.cognitive.NavigationStrategy2D
import it.unibo.alchemist.model.cognitive.PedestrianProperty
import it.unibo.alchemist.model.cognitive.navigation.ReachKnownDestination
import it.unibo.alchemist.model.environments.Euclidean2DEnvironmentWithGraph
import it.unibo.alchemist.model.geometry.ConvexPolygon
import it.unibo.alchemist.model.geometry.Euclidean2DConvexShape
import it.unibo.alchemist.model.geometry.navigationgraph.Euclidean2DPassage
import it.unibo.alchemist.util.Arrays.toPositions
import it.unibo.alchemist.util.lazyMutable
/**
* A [CognitiveAgentNavigationAction2D] using [ReachKnownDestination] navigation strategy.
*
* @param T the concentration type.
* @param L the type of landmarks of the node's cognitive map.
* @param R the type of edges of the node's cognitive map, representing the [R]elations between landmarks.
*/
class CognitiveAgentReachKnownDestination(
environment: Euclidean2DEnvironmentWithGraph<*, T, ConvexPolygon, Euclidean2DPassage>,
reaction: Reaction,
override val pedestrian: PedestrianProperty,
vararg destinations: Number,
) : CognitiveAgentNavigationAction2D(environment, reaction, pedestrian) {
override var strategy: NavigationStrategy2D by lazyMutable {
ReachKnownDestination(this, destinations.toPositions(environment))
}
}