-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.Reaction,java.io.Serializable,java.lang.Comparable
public final class SAPEREGradient<P extends Position<P>> extends AbstractReaction<List<ILsaMolecule>>
This class provides a fast and stable gradient implementation, inspired on the NBR construct used in Proto.
-
-
Constructor Summary
Constructors Constructor Description 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. SAPEREGradient(Environment<List<ILsaMolecule>, P> env, ILsaNode n, TimeDistribution<List<ILsaMolecule>> td, String sourceTemplate, String gradientTemplate, int valuePosition, String expression, String contextTemplate, double gradThreshold)Builds a new SAPERE Gradient.
-
Method Summary
Modifier and Type Method Description booleancanExecute()Reaction<List<ILsaMolecule>>cloneOnNewNode(Node<List<ILsaMolecule>> node, Time currentTime)voidexecute()List<Action<List<ILsaMolecule>>>getActions()List<Condition<List<ILsaMolecule>>>getConditions()ILsaNodegetLsaNode()doublegetRate()-
Methods inherited from class it.unibo.alchemist.model.implementations.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.interfaces.Reaction
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 environmentnode- the node where this reaction is scheduledsourceTemplate- a template ILsaMolecule representing the sourcegradientTemplate- 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 evaporatestimeDistribution- Markovian Rate
-
SAPEREGradient
SAPEREGradient(Environment<List<ILsaMolecule>, P> env, ILsaNode n, TimeDistribution<List<ILsaMolecule>> td, String sourceTemplate, String gradientTemplate, int valuePosition, String expression, String contextTemplate, double gradThreshold)
Builds a new SAPERE Gradient.- Parameters:
env- the current environmentn- the node where this reaction is scheduledtd- Markovian RatesourceTemplate- a template ILsaMolecule representing the sourcegradientTemplate- 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
-
-
Method Detail
-
canExecute
boolean canExecute()
-
cloneOnNewNode
Reaction<List<ILsaMolecule>> cloneOnNewNode(Node<List<ILsaMolecule>> node, Time currentTime)
-
execute
void execute()
-
getActions
List<Action<List<ILsaMolecule>>> getActions()
-
getConditions
List<Condition<List<ILsaMolecule>>> getConditions()
-
getLsaNode
ILsaNode getLsaNode()
-
getRate
double getRate()
-
-
-
-