HeadTowardTarget

class HeadTowardTarget<T>(node: Node<T>, environment: Physics2DEnvironment<T>, reaction: Reaction<T>, target: Molecule, angularSpeedDegrees: Double = 360.0) : AbstractAction<T>

Reads the target's absolute coordinates from the target molecule contained in node and sets the node's heading accordingly.

Constructors

Link copied to clipboard
constructor(node: Node<T>, environment: Physics2DEnvironment<T>, reaction: Reaction<T>, target: Molecule, angularSpeedDegrees: Double = 360.0)

Functions

Link copied to clipboard
open override fun cloneAction(node: Node<T>, reaction: Reaction<T>): HeadTowardTarget<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()

Sets the heading of the node according to the target molecule.

Link copied to clipboard
open override fun getContext(): Context
Link copied to clipboard
override fun getOutboundDependencies(): ListSet
Link copied to clipboard
open override fun toString(): String