-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.Action,java.io.Serializable
public final class RunProtelisProgram<P extends Position<P>> implements Action<Object>
-
-
Field Summary
Fields Modifier and Type Field Description private final Environment<Object, P>environmentprivate final ProtelisNode<P>nodeprivate final doubleretentionTimeprivate transient AlchemistExecutionContext<P>executionContext
-
Constructor Summary
Constructors Constructor Description RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program)RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program, double retentionTime)RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program, String packetLossDistributionName, Array<double> packetLossDistributionParameters)RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program, double retentionTime, String packetLossDistributionName, Array<double> packetLossDistributionParameters)RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, ProtelisProgram program, double retentionTime, String packetLossDistributionName, Array<double> packetLossDistributionParameters)RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program, double retentionTime, RealDistribution packetLossDistance)
-
Method Summary
Modifier and Type Method Description Environment<Object, P>getEnvironment()ProtelisNode<P>getNode()doublegetRetentionTime()AlchemistExecutionContext<P>getExecutionContext()Provides an access to the underlying org.protelis.vm.ExecutionContext. MoleculeasMolecule()RunProtelisProgram<P>cloneAction(Node<Object> node, Reaction<Object> reaction)booleanequals(Object other)voidexecute()ContextgetContext()ListSet<out Dependency>getOutboundDependencies()RandomGeneratorgetRandomGenerator()inthashCode()booleanisComputationalCycleComplete()voidprepareForComputationalCycle()Resets the computation status (used for dependency management). StringtoString()-
-
Constructor Detail
-
RunProtelisProgram
RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program)
- Parameters:
environment- the environmentnode- the nodereaction- the reactionrandomGenerator- the random engineprogram- the Protelis program
-
RunProtelisProgram
RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program, double retentionTime)
- Parameters:
environment- the environmentnode- the nodereaction- the reactionrandomGenerator- the random engineprogram- the Protelis programretentionTime- how long the messages will be stored.
-
RunProtelisProgram
RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program, String packetLossDistributionName, Array<double> packetLossDistributionParameters)
- Parameters:
environment- the environmentnode- the nodereaction- the reactionrandomGenerator- the random engineprogram- the Protelis programpacketLossDistributionName- the package loss probability, scaling with distance.packetLossDistributionParameters- parameters that will be passed when building the packet loss distribution
-
RunProtelisProgram
RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program, double retentionTime, String packetLossDistributionName, Array<double> packetLossDistributionParameters)
- Parameters:
environment- the environmentnode- the nodereaction- the reactionrandomGenerator- the random engineprogram- the Protelis programretentionTime- how long the messages will be stored.packetLossDistributionName- the package loss probability, scaling with distance.packetLossDistributionParameters- parameters that will be passed when building the packet loss distribution
-
RunProtelisProgram
RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, ProtelisProgram program, double retentionTime, String packetLossDistributionName, Array<double> packetLossDistributionParameters)
- Parameters:
environment- the environmentnode- the nodereaction- the reactionrandomGenerator- the random engineprogram- the Protelis programretentionTime- how long the messages will be stored.packetLossDistributionName- the package loss probability, scaling with distance.packetLossDistributionParameters- parameters that will be passed when building the packet loss distribution
-
RunProtelisProgram
RunProtelisProgram(Environment<Object, P> environment, ProtelisNode<P> node, Reaction<Object> reaction, RandomGenerator randomGenerator, String program, double retentionTime, RealDistribution packetLossDistance)
- Parameters:
environment- the environmentnode- the nodereaction- the reactionrandomGenerator- the random engineprogram- the Protelis programretentionTime- how long the messages will be stored.packetLossDistance- the package loss probability, scaling with distance.
-
-
Method Detail
-
getEnvironment
Environment<Object, P> getEnvironment()
-
getNode
ProtelisNode<P> getNode()
-
getRetentionTime
double getRetentionTime()
-
getExecutionContext
AlchemistExecutionContext<P> getExecutionContext()
Provides an access to the underlying org.protelis.vm.ExecutionContext.
-
asMolecule
Molecule asMolecule()
-
cloneAction
RunProtelisProgram<P> cloneAction(Node<Object> node, Reaction<Object> reaction)
-
execute
void execute()
-
getContext
Context getContext()
-
getOutboundDependencies
ListSet<out Dependency> getOutboundDependencies()
-
getRandomGenerator
RandomGenerator getRandomGenerator()
-
hashCode
int hashCode()
-
isComputationalCycleComplete
boolean isComputationalCycleComplete()
-
prepareForComputationalCycle
void prepareForComputationalCycle()
Resets the computation status (used for dependency management).
-
-
-
-