-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.Action,java.io.Serializable
public abstract class AbstractNeighborAction<T> extends AbstractRandomizableAction<T>
Represents an action on a neighbor.
-
-
Method Summary
Modifier and Type Method Description abstract AbstractNeighborAction<T>cloneAction(Node<T> node, Reaction<T> reaction)voidexecute()Execute the action on a random neighbor if the node has a neighborhood. abstract voidexecute(Node<T> targetNode)Execute the action on the given target node. final ContextgetContext()-
-
Method Detail
-
cloneAction
abstract AbstractNeighborAction<T> cloneAction(Node<T> node, Reaction<T> reaction)
-
execute
void execute()
Execute the action on a random neighbor if the node has a neighborhood. Otherwise do nothing.
-
execute
abstract void execute(Node<T> targetNode)
Execute the action on the given target node. NOTE, it is NOT guaranteed that this method checks if the target node is in the actual neighborhood of the node.
- Parameters:
targetNode- the node where the action will be execute
-
getContext
final Context getContext()
-
-
-
-