Add the run loop skeleton
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""Entry point for a single scenario run."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class Step:
|
||||
action: str
|
||||
target: str
|
||||
note: str = ""
|
||||
|
||||
|
||||
def run(scenario: str, site: str, max_steps: int = 40) -> list[Step]:
|
||||
"""Walk one scenario against one site and return the steps that were taken."""
|
||||
steps: list[Step] = []
|
||||
for _ in range(max_steps):
|
||||
step = decide(site, steps)
|
||||
if step is None:
|
||||
break
|
||||
steps.append(step)
|
||||
return steps
|
||||
|
||||
|
||||
def decide(site: str, history: list[Step]) -> Step | None:
|
||||
"""Pick the next action, or None when the journey is finished."""
|
||||
raise NotImplementedError
|
||||
Reference in New Issue
Block a user