Interface SimulationTask<I>

Type Parameters:
I - plugin-defined input for the current run

public interface SimulationTask<I>
Hook points for adding domain-specific simulation rules.
  • Method Details

    • onTick

      default void onTick(I input, SimulationGrid grid)
      Called once before path expansion begins.

      Use this for per-tick updates that do not need the generated reachable tile set.

      Parameters:
      input - plugin-defined state for this run
      grid - mutable simulation grid for this run
    • begin

      default void begin(I input, SimulationGrid grid)
      Called once before path expansion begins, after onTick(Object, SimulationGrid).

      Tasks may block static nodes here so expansion cannot enter them.

      Parameters:
      input - plugin-defined state for this run
      grid - mutable simulation grid for this run
    • step

      default boolean step(I input, SimulationGrid grid, Coord from, Coord to, int tick)
      Decides whether expansion may traverse the edge from from to to on tick.
      Parameters:
      input - plugin-defined state for this run
      grid - mutable simulation grid for this run
      from - current coordinate
      to - candidate destination coordinate
      tick - simulated tick when to would be reached
      Returns:
      true to allow this edge, false to reject it
    • visit

      default void visit(I input, SimulationGrid grid, SimulationNode node)
      Called for each reachable tile after expansion.

      Use this to add penalty, score, or mark reachable nodes to avoid based on their tick and path state.

      Parameters:
      input - plugin-defined state for this run
      grid - mutable simulation grid for this run
      node - reachable candidate node to evaluate
    • end

      default void end(I input, SimulationGrid grid)
      Called after all reachable nodes have been visited and before the best result is selected.
      Parameters:
      input - plugin-defined state for this run
      grid - mutable simulation grid for this run