Enum Class AgentAction
- All Implemented Interfaces:
Serializable
,Comparable<AgentAction>
,Constable
This enumeration contains common agent actions that they can perform.
It is designed to ease the creation of GUIs for agents by providing a way to create
Action
s for common agent actions.
Example usage:
AgentAction action = AgentAction.LAUNCH_AGENT;
Action fxAction = action.newActionFor(agent, parameters);
- Since:
- MaDKit 5.0.0.14
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAction to broadcast a message.Action to create a group.Action to kill an agent.Action to launch an agent.Action to leave a group.Action to leave a role.Action to reload an agent.Action to request a role.Action to send a message. -
Method Summary
Modifier and TypeMethodDescriptionstatic ActionGroup
createAgentFxActionGroup
(Agent agent) Creates an action group for the given agent.getActionFor
(Agent agent, Object... parameters) Builds an FX action that will make the agent perform the corresponding operation if possible.static AgentAction
Returns the enum constant of this class with the specified name.static AgentAction[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LAUNCH_AGENT
Action to launch an agent. -
RELOAD
Action to reload an agent. -
CREATE_GROUP
Action to create a group. -
REQUEST_ROLE
Action to request a role. -
LEAVE_ROLE
Action to leave a role. -
LEAVE_GROUP
Action to leave a group. -
SEND_MESSAGE
Action to send a message. -
BROADCAST_MESSAGE
Action to broadcast a message. -
KILL_AGENT
Action to kill an agent.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getActionFor
Builds an FX action that will make the agent perform the corresponding operation if possible.- Parameters:
agent
- the agent that will send the message to the kernelparameters
- the parameters for the action- Returns:
- the new corresponding action
-
createAgentFxActionGroup
Creates an action group for the given agent. The action group includes actions for reloading, launching, and killing the agent.- Parameters:
agent
- the agent for which to create the action group- Returns:
- an ActionGroup containing the actions for the agent
-