Class SAPEREGradient

  • All Implemented Interfaces:
    it.unibo.alchemist.model.Actionable , it.unibo.alchemist.model.Reaction , java.io.Serializable , java.lang.Comparable

    
    public final class SAPEREGradient<P extends Position<P>>
    extends AbstractReaction<T>
                        

    This class provides a fast and stable gradient implementation, inspired on the NBR construct used in Proto.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final TimeDistribution<T> timeDistribution
      public final Node<T> node
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      boolean canExecute()
      Reaction<List<ILsaMolecule>> cloneOnNewNode(@Nonnull() Node<List<ILsaMolecule>> node, @Nonnull() Time currentTime)
      void execute()
      List<Action<List<ILsaMolecule>>> getActions()
      List<Condition<List<ILsaMolecule>>> getConditions()
      ILsaNode getLsaNode()
      double getRate()
      • Methods inherited from class it.unibo.alchemist.model.reactions.AbstractReaction

        compareTo, equals, getInboundDependencies, getInputContext, getNode, getOutboundDependencies, getOutputContext, getTau, getTimeDistribution, hashCode, initializationComplete, setActions, setConditions, toString, update
      • Methods inherited from class it.unibo.alchemist.model.Actionable

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

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

      • SAPEREGradient

        SAPEREGradient(Environment<List<ILsaMolecule>, P> environment, ILsaNode node, ILsaMolecule sourceTemplate, ILsaMolecule gradientTemplate, int valuePosition, String expression, ILsaMolecule contextTemplate, double gradThreshold, TimeDistribution<List<ILsaMolecule>> timeDistribution)
        Builds a new SAPERE Gradient.
        Parameters:
        environment - the current environment
        node - the node where this reaction is scheduled
        sourceTemplate - a template ILsaMolecule representing the source
        gradientTemplate - a template ILsaMolecule representing the gradient.
        valuePosition - the point at which the computation of the new values should be inserted.
        expression - the expression to use in order to calculate the new gradient value.
        contextTemplate - a template ILsaMolecule.
        gradThreshold - if the value of the gradient grows above this threshold, the gradient evaporates
        timeDistribution - Markovian Rate
      • SAPEREGradient

        SAPEREGradient(Environment<List<ILsaMolecule>, P> environment, ILsaNode node, TimeDistribution<List<ILsaMolecule>> timeDistribution, String sourceTemplate, String gradientTemplate, int valuePosition, String expression, String contextTemplate, double gradThreshold)
        Builds a new SAPERE Gradient.
        Parameters:
        environment - the current environment
        node - the node where this reaction is scheduled
        timeDistribution - Markovian Rate
        sourceTemplate - a template ILsaMolecule representing the source
        gradientTemplate - a template ILsaMolecule representing the gradient.
        valuePosition - the point at which the computation of the new values should be inserted.
        expression - the expression to use in order to calculate the new gradient value.
        contextTemplate - a template ILsaMolecule.
        gradThreshold - if the value of the gradient grows above this threshold, the gradient evaporates