-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.Action,java.io.Serializable
public class ToggleMolecule<T extends Object> extends 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.
-
-
Constructor Summary
Constructors Constructor Description ToggleMolecule(Node<T> node, Molecule molecule, T concentration)
-
Method Summary
Modifier and Type Method Description ToggleMolecule<T>cloneAction(Node<T> node, Reaction<T> reaction)Unitexecute()Toggles concentration. ContextgetContext()-
Methods inherited from class it.unibo.alchemist.model.implementations.actions.ToggleMolecule
declareDependencyTo, getConcentration, getNode, getOutboundDependencies, nodeContains, removeConcentration, setConcentration, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
cloneAction
ToggleMolecule<T> cloneAction(Node<T> node, Reaction<T> reaction)
-
getContext
Context getContext()
-
-
-
-