Capacity remedy API

Capacity remedies for weather/outage-aware recourse.

The window remedy extends the fall work window while keeping the crew and machine mix fixed. The added-crew comparison buys one or more relief crews and machines and charges explicit resource costs. Both are operational what-ifs, not field schedules.

class brushline.strategic.capacity_remedy.CapacityRemedyCase(*, name: str, window_days: Annotated[int, Ge(ge=1), Le(le=366)], extra_crews: Annotated[int, Ge(ge=0)], extra_machines: Annotated[int, Ge(ge=0)], summary: WeatherCaseSummary)[source]

Bases: BaseModel

One capacity-remedy case.

model_config = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class brushline.strategic.capacity_remedy.CapacityRemedyResult(*, schema_version: Literal['brushline.capacity-remedy.v1'] = 'brushline.capacity-remedy.v1', instance_id: str, episodes: Annotated[int, Ge(ge=1)], seed: int, years: list[int], solver: Literal['exact', 'heuristic'], lookahead_years: Annotated[int, Ge(ge=1)], cases: list[CapacityRemedyCase], created_utc: datetime)[source]

Bases: BaseModel

Added crew and longer-window remedies on a common comparison.

model_config = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class brushline.strategic.capacity_remedy.WindowRemedyCase(*, window_days: Annotated[int, Ge(ge=1), Le(le=366)], summary: WeatherCaseSummary)[source]

Bases: BaseModel

One fall-window length.

model_config = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class brushline.strategic.capacity_remedy.WindowRemedyResult(*, schema_version: Literal['brushline.window-remedy.v1'] = 'brushline.window-remedy.v1', instance_id: str, episodes: Annotated[int, Ge(ge=1)], seed: int, years: list[int], solver: Literal['exact', 'heuristic'], lookahead_years: Annotated[int, Ge(ge=1)], cases: list[WindowRemedyCase], created_utc: datetime)[source]

Bases: BaseModel

Observed-calendar awareness across fall-window lengths.

model_config = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

brushline.strategic.capacity_remedy.evaluate_capacity_remedy(*, instance_id: str, plan: StatefulPlan, segments: list[StatefulSegment], methods: list[StatefulMethod], periods: list[StatefulPeriod], crews: list[ShiftCrew], machines: list[ShiftMachine], extra_crews: list[ShiftCrew], extra_machines: list[ShiftMachine], windows: list[int], config: StatefulConfig | None = None, episodes: int = 20, seed: int = 7, solver: Literal['exact', 'heuristic'] = 'exact', heuristic_iterations: int = 100, lookahead_years: int = 2, calendar: WeatherCalendarConfig | None = None, crew_day_cost: float = 1200.0, machine_day_cost: float = 900.0, supervision_fraction: float = 0.08, overhead_fraction: float = 0.1, seasonal_overhead_per_crew: float = 2500.0, created_utc: datetime | None = None) → CapacityRemedyResult[source]

Compare baseline, added crew, and longer-window remedies.

brushline.strategic.capacity_remedy.evaluate_window_remedy(*, instance_id: str, plan: StatefulPlan, segments: list[StatefulSegment], methods: list[StatefulMethod], periods: list[StatefulPeriod], crews: list[ShiftCrew], machines: list[ShiftMachine], windows: list[int], config: StatefulConfig | None = None, episodes: int = 20, seed: int = 7, solver: Literal['exact', 'heuristic'] = 'exact', heuristic_iterations: int = 100, lookahead_years: int = 2, calendar: WeatherCalendarConfig | None = None, created_utc: datetime | None = None) → WindowRemedyResult[source]

Evaluate observed-calendar awareness across fall-window lengths.