public class Action<T extends Agent<?>> extends Section
Constructor and Description |
---|
Action(java.lang.Class<T> clazz,
SerializableConsumer<T> handler) |
Modifier and Type | Method and Description |
---|---|
static <T extends Agent<?>> |
create(java.lang.Class<T> clazz,
SerializableConsumer<T> handler)
Create a new action for the given Agent class.
|
void |
execute(T agent) |
public Action(java.lang.Class<T> clazz, SerializableConsumer<T> handler)
public static <T extends Agent<?>> Action<T> create(java.lang.Class<T> clazz, SerializableConsumer<T> handler)
An Action can be run directly against an [[simudyne.core.abm.AgentSystem]] or composed into a [[simudyne.core.abm.Sequence]] or [[simudyne.core.abm.Split]].
T
- Type of the agentclazz
- Agent class for which this action is defined.handler
- The logic of the action to be run.public void execute(T agent)