Interface SpartanActionManager
public interface SpartanActionManager
Manages the registry of actions available to an agent.
Concept: If the Agent is the driver, the ActionManager is the steering wheel and pedals. It translates the neural network's mathematical output (just numbers) into meaningful logic events. You must register every possible move (Jump, Shoot, Move Left) with this manager before starting the agent.
-
Method Summary
Modifier and TypeMethodDescription@NotNull List<SpartanAction> Returns all registered actions.@NotNull List<SpartanAction> getActionsByIdentifier(@NotNull String identifier) Finds and returns all actions matching a string identifier.<SpartanActionType extends SpartanAction>
@NotNull List<SpartanActionType> getActionsByType(@NotNull Class<SpartanActionType> actionClass) Finds and returns all actions of a specific class type.@NotNull SpartanActionManagerregisterAction(SpartanAction action) Registers a new action.
-
Method Details
-
registerAction
Registers a new action. The order of registration matters - it corresponds to the output indices of the neural network.- Parameters:
action- the action to register- Returns:
- this manager (for chaining)
-
getActions
Returns all registered actions.- Returns:
- unmodifiable list of actions
-
getActionsByType
@NotNull <SpartanActionType extends SpartanAction> @NotNull List<SpartanActionType> getActionsByType(@NotNull @NotNull Class<SpartanActionType> actionClass) Finds and returns all actions of a specific class type. Useful for retrieving a set of related actions (e.g., all MovementActions).- Type Parameters:
SpartanActionType- the generic type- Parameters:
actionClass- the class type to filter by- Returns:
- list of matching actions
-
getActionsByIdentifier
Finds and returns all actions matching a string identifier.- Parameters:
identifier- the identifier to search for- Returns:
- list of matching actions
-