alchemist-incarnation-protelis / it.unibo.alchemist.protelis / AlchemistExecutionContext

AlchemistExecutionContext

class AlchemistExecutionContext<P : Position<P>!> : AbstractExecutionContext<AlchemistExecutionContext<P>!>, SpatiallyEmbeddedDevice<Double!>, LocalizedDevice, TimeAwareDevice<Number!>

Constructors

<init>

AlchemistExecutionContext(environment: Environment<Any!, P>!, localNode: ProtelisNode<P>!, reaction: Reaction<Any!>!, random: RandomGenerator!, networkManager: AlchemistNetworkManager!)

Properties

APPROXIMATE_NBR_RANGE

Put this Molecule inside nodes that should compute distances using routes approximating them. It only makes sense in case the environment is a MapEnvironment

static val APPROXIMATE_NBR_RANGE: Molecule!

USE_ROUTES_AS_DISTANCES

Put this Molecule inside nodes that should compute distances using routes. It only makes sense in case the environment is a MapEnvironment

static val USE_ROUTES_AS_DISTANCES: Molecule!

Functions

distanceTo

Computes the distance between two nodes, through Environment#getDistanceBetweenNodes(Node, Node).

fun distanceTo(target: DeviceUID!): Double
fun distanceTo(target: Int): Double

equals

fun equals(other: Any?): Boolean

getCoordinates

fun getCoordinates(): Tuple!

getCurrentTime

fun getCurrentTime(): Number!

getDevicePosition

fun getDevicePosition(): P

getDeviceUID

fun getDeviceUID(): DeviceUID!

getEnvironmentAccess

fun getEnvironmentAccess(): Environment<Any!, P>!

hashCode

fun hashCode(): Int

instance

fun instance(): AlchemistExecutionContext<P>!

nbrDelay

fun nbrDelay(): Field<Any!>!

nbrLag

fun nbrLag(): Field<Any!>!

nbrRange

fun nbrRange(): Field<Double!>!

nbrVector

fun nbrVector(): Field<Tuple!>!

nextRandomDouble

fun nextRandomDouble(): Double

routingDistance

Computes the distance along a map. Requires a MapEnvironment.

fun routingDistance(dest: Node<Any!>!): Double
fun routingDistance(dest: Number!): Double
fun routingDistance(dest: GeoPosition!): Double
fun routingDistance(dest: Tuple!): Double