FollowAtDistance

class FollowAtDistance<T>(node: Node<T>, reaction: Reaction<T>, environment: Environment<T, Euclidean2DPosition>, target: Molecule, distance: Double, speed: Double) : AbstractAction<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

node

the follower node.

reaction

the reaction hosting this action.

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(node: Node<T>, reaction: Reaction<T>, environment: Environment<T, Euclidean2DPosition>, target: Molecule, distance: Double, speed: Double)

Properties

Link copied to clipboard
open override val context: Context
Link copied to clipboard

Functions

Link copied to clipboard
open override fun cloneAction(node: Node<T>, reaction: Reaction<T>): FollowAtDistance<T>

This method allows to clone this action on a new node. It may result useful to support runtime creation of nodes with the same reaction programming, e.g. for morphogenesis.

Link copied to clipboard
open override fun execute()

Effectively executes this action.

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