ToggleMolecule

open class ToggleMolecule<T>(node: Node<T>, molecule: Molecule, concentration: T) : AbstractAction<T>

Treats molecule as a switch:

  • if it is present, then it's removed from node;

  • otherwise, it is inserted in node with the provided concentration.

Inheritors

Constructors

Link copied to clipboard
constructor(node: Node<T>, molecule: Molecule, concentration: T)

Functions

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

Toggles concentration.

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