47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
from __future__ import annotations
|
|
|
|
"""Seed DSL generator for FleetOpt MVP interoperability.
|
|
|
|
This module provides a tiny helper to generate a canonical seed structure
|
|
consisting of LocalRobotPlanDSL, SharedSignalsDSL and PlanDeltaDSL instances
|
|
that can be used to bootstrap interoperability between adapters and tests.
|
|
"""
|
|
|
|
from core.dsl import LocalRobotPlanDSL, SharedSignalsDSL, PlanDeltaDSL
|
|
|
|
|
|
def generate_seed() -> dict:
|
|
# Simple, deterministic seed for two robots across two fleets
|
|
plan1 = LocalRobotPlanDSL(
|
|
fleet_id="fleet-A",
|
|
robot_id="robot-1",
|
|
tasks=["pickup", "deliver"],
|
|
path=[{"x": 0.0, "y": 0.0}, {"x": 1.0, "y": 1.0}],
|
|
objectives={"energy": 0.5},
|
|
)
|
|
plan2 = LocalRobotPlanDSL(
|
|
fleet_id="fleet-B",
|
|
robot_id="robot-2",
|
|
tasks=["inspect"],
|
|
path=[{"x": 0.0, "y": 0.0}, {"x": -1.0, "y": 2.0}],
|
|
objectives={"energy": 0.3},
|
|
)
|
|
|
|
signals = SharedSignalsDSL(signals={"energy": 0.4})
|
|
delta = PlanDeltaDSL(
|
|
delta_id="delta-sample",
|
|
fleet_id="fleet-A",
|
|
changes={"cost_improvement": 0.2},
|
|
version=1,
|
|
)
|
|
|
|
return {
|
|
"plan1": plan1.to_model().__dict__,
|
|
"plan2": plan2.to_model().__dict__,
|
|
"signals": signals.to_model().__dict__,
|
|
"delta": delta.to_model().__dict__,
|
|
}
|
|
|
|
|
|
__all__ = ["generate_seed"]
|