FollowAtDistance

class FollowAtDistance<T>(reaction: NodeReaction<T>, environment: Environment<T, Euclidean2DPosition>, target: Molecule, distance: Double, speed: Double) : AbstractLocalAction<T>

Causes a node to follow a destination read from a Molecule, maintaining a fixed distance and respecting a maximum speed.

The destination is read from the specified target molecule and interpreted as coordinates or a tuple.

Parameters

reaction

the reaction hosting this action, whose node follows the destination.

environment

the environment containing the nodes.

target

the molecule carrying the destination coordinates.

distance

the distance to keep from the destination.

speed

the maximum movement speed.

Type Parameters

T

the concentration type.

Constructors

Link copied to clipboard
constructor(reaction: NodeReaction<T>, environment: Environment<T, Euclidean2DPosition>, target: Molecule, distance: Double, speed: Double)

Properties

Link copied to clipboard
override val reaction: NodeReaction<T>

The NodeReaction owning this action, hosted by targetNode.

Link copied to clipboard

Functions

Link copied to clipboard
override fun cloneAction(newReaction: Reaction<T>): Action<T>

Creates an equivalent action owned by newReaction, such as a reaction cloned onto a new node. An action targeting the host of its reaction targets the host of newReaction, which must then be a Node; an action targeting any other node keeps its target.

Link copied to clipboard
open override fun execute()

Applies this action to the model.

Link copied to clipboard
infix fun Action<*>.shouldEqual(other: Action<*>)
Link copied to clipboard
open override fun toString(): String