-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.Action
,it.unibo.alchemist.model.interfaces.Action
,it.unibo.alchemist.model.interfaces.ILsaAction
,java.io.Serializable
public final class SAPEREMoveLSAToAgent extends SAPEREAgent
This agent matches a template, removes a single instance of it from the current node and moves the LSA to another node (specified at creation time). Please note that, since the destination could be anywhere in the system, this action has a GLOBAL Context, and thus may trigger a large number of updates, slowing down the whole simulation. Handle with care.
-
-
Constructor Summary
Constructors Constructor Description SAPEREMoveLSAToAgent(Environment<out Object, out Object> env, ILsaNode node, int destId, ILsaMolecule template)
This is the constructor that should be called from DSL. SAPEREMoveLSAToAgent(ILsaNode node, ILsaNode dest, ILsaMolecule template)
-
Method Summary
Modifier and Type Method Description void
execute()
Context
getContext()
-
Methods inherited from class it.unibo.alchemist.model.implementations.actions.SAPEREAgent
cloneAction, toString
-
Methods inherited from class it.unibo.alchemist.model.implementations.actions.LsaAbstractAction
cloneAction, getNode, setExecutionContext
-
Methods inherited from class it.unibo.alchemist.model.implementations.actions.AbstractAction
declareDependencyTo, getConcentration, getNode, getOutboundDependencies, nodeContains, removeConcentration, setConcentration, toString
-
Methods inherited from class it.unibo.alchemist.model.interfaces.Action
cloneAction, execute, getContext
-
Methods inherited from class it.unibo.alchemist.model.interfaces.ILsaAction
cloneAction, getOutboundDependencies, setExecutionContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SAPEREMoveLSAToAgent
SAPEREMoveLSAToAgent(Environment<out Object, out Object> env, ILsaNode node, int destId, ILsaMolecule template)
This is the constructor that should be called from DSL.- Parameters:
env
- the current environmentnode
- the source node, where this action is programmeddestId
- the destination node idtemplate
- the template LSA to match and move
-
SAPEREMoveLSAToAgent
SAPEREMoveLSAToAgent(ILsaNode node, ILsaNode dest, ILsaMolecule template)
- Parameters:
node
- the source node, where this action is programmeddest
- the destination node, where this action will move the matchedintancetemplate
- the template LSA to match and move
-
-
Method Detail
-
execute
void execute()
-
getContext
Context getContext()
-
-
-
-