Package com.kraken.api.simulation
Class SimulationDecisionAdapter
- java.lang.Object
-
- com.kraken.api.simulation.SimulationDecisionAdapter
-
public final class SimulationDecisionAdapter extends java.lang.ObjectConverts decision-tree simulation results into executable in-game movement and interaction actions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimulationDecisionAdapter.ExecutableActionRuntime action payload translated from a simulation decision.
-
Constructor Summary
Constructors Constructor Description SimulationDecisionAdapter(Context ctx, MovementService movementService)Constructs a decision adapter for converting and executing simulation outcomes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimulationDecisionAdapter.ExecutableActionadapt(DecisionTreeSearch.Result result, SimulationState rootState)Converts a decision result into a movement-only executable action.SimulationDecisionAdapter.ExecutableActionadapt(DecisionTreeSearch.Result result, SimulationState rootState, java.lang.String interactionAction, int interactionDistance)Converts a decision result into movement and optional NPC interaction.booleanexecute(SimulationDecisionAdapter.ExecutableAction action)Executes movement and optional NPC interaction in the game client.
-
-
-
Constructor Detail
-
SimulationDecisionAdapter
@Inject public SimulationDecisionAdapter(Context ctx, MovementService movementService)
Constructs a decision adapter for converting and executing simulation outcomes.- Parameters:
ctx- shared API context.movementService- movement executor service.
-
-
Method Detail
-
adapt
public SimulationDecisionAdapter.ExecutableAction adapt(DecisionTreeSearch.Result result, SimulationState rootState)
Converts a decision result into a movement-only executable action.- Parameters:
result- The decision tree search resultrootState- The root simulation state- Returns:
- ExecutableAction an action which can be taken by the player
-
adapt
public SimulationDecisionAdapter.ExecutableAction adapt(DecisionTreeSearch.Result result, SimulationState rootState, java.lang.String interactionAction, int interactionDistance)
Converts a decision result into movement and optional NPC interaction.- Parameters:
result- Decision tree result.rootState- State used as the decision root.interactionAction- NPC action to execute (for example "Attack"), null/empty disables interactions.interactionDistance- Chebyshev distance for selecting an interaction target.- Returns:
- Executable action translated from the simulation decision.
-
execute
public boolean execute(SimulationDecisionAdapter.ExecutableAction action)
Executes movement and optional NPC interaction in the game client.- Parameters:
action- An executable action to perform- Returns:
- true when at least one action was executed.
-
-