Class ToggleMoleculeRandomly

  • All Implemented Interfaces:
    it.unibo.alchemist.model.Action , java.io.Serializable

    
    public class ToggleMoleculeRandomly<T extends Object>
    extends ToggleMolecule<T>
                        

    Treats molecule as a probabilistic switch:

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

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

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      ToggleMoleculeRandomly<T> cloneAction(Node<T> node, Reaction<T> reaction)
      Unit execute() Rolls the dice and toggles the molecule.
      • Methods inherited from class it.unibo.alchemist.model.actions.ToggleMolecule

        getContext
      • Methods inherited from class it.unibo.alchemist.model.actions.AbstractAction

        getOutboundDependencies, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ToggleMoleculeRandomly

        ToggleMoleculeRandomly(Node<T> node, RandomGenerator randomGenerator, Molecule molecule, T concentration, Double odds)
        Parameters:
        node - the node containing the molecule to toggle
        randomGenerator - random number generator to use
        molecule - the molecule to toggle
        concentration - the concentration to use for the "on" state
        odds - probability to toggle the molecule every time the action is triggered