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)

Properties

Link copied to clipboard
open override val context: Context
Link copied to clipboard
override val outboundDependencies: @EnhancedNullability org/danilopianini/util/ListSet<out it/unibo/alchemist/model/Dependency!>

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