fhops.model.milp.tactical_operational Module

Pyomo builder and solver driver for the Phase 6 TOPM-inspired tactical–operational MILP. The model supports continuous, semi-continuous, and whole-block harvest modes; product flows; facility inventories; purchases; optional roads/silviculture/fleet investment; and cost/profit/NPV objective profiles.

TOPM-inspired tactical–operational MILP builder and driver.

This module implements the Phase 6 aggregate planning model. It operates on TacticalOperationalScenario objects and chooses block × system × period harvest areas subject to continuous, semi-continuous, or whole-block quantity modes; product yields; fleet capacity; and facility demand targets. The same model carries product transport flows, outside purchases, facility consumption/inventory, optional road activation, silviculture follow-up, and fleet investment modules. The objective supports discounted cost, profit, and NPV-style profiles, with objective decomposition and model-size/timing telemetry returned to callers.

class fhops.model.milp.tactical_operational.DemandBasis(value)[source]

Bases: StrEnum

Facility demand envelope component enforced by the tactical–operational MILP.

MINIMUM = 'minimum'
TARGET = 'target'
class fhops.model.milp.tactical_operational.TacticalHarvestMode(value)[source]

Bases: StrEnum

Supported harvest-quantity semantics for aggregate planning.

CONTINUOUS = 'continuous'
SEMI_CONTINUOUS = 'semi_continuous'
WHOLE_BLOCK = 'whole_block'
class fhops.model.milp.tactical_operational.TacticalOperationalMilpBundle(scenario, config)[source]

Bases: object

Normalized model bundle for tactical–operational MILP construction.

Parameters:
config: TacticalOperationalMilpConfig
scenario: TacticalOperationalScenario
class fhops.model.milp.tactical_operational.TacticalOperationalMilpConfig(harvest_mode=TacticalHarvestMode.SEMI_CONTINUOUS, demand_basis=DemandBasis.TARGET, enable_roads=False, enable_silviculture=False, enable_fleet_investment=False)[source]

Bases: object

Configuration for the aggregate tactical–operational MILP.

Parameters:
  • harvest_mode (fhops.model.milp.tactical_operational.TacticalHarvestMode) – Harvest-quantity semantics. semi_continuous enforces option-specific minimum active areas; continuous relaxes the minimum; whole_block forces the full operable area.

  • demand_basis (fhops.model.milp.tactical_operational.DemandBasis) – Whether facility target_m3 (default) or minimum_m3 values drive required production.

  • enable_fleet_investment (bool) – Optional infrastructure modules. They default to False so a scenario without explicit module configuration reproduces the product-flow core exactly.

  • enable_roads (bool)

  • enable_silviculture (bool)

  • enable_fleet_investment

demand_basis: DemandBasis = 'target'
enable_fleet_investment: bool = False
enable_roads: bool = False
enable_silviculture: bool = False
harvest_mode: TacticalHarvestMode = 'semi_continuous'
fhops.model.milp.tactical_operational.build_tactical_operational_bundle(scenario, *, harvest_mode=TacticalHarvestMode.SEMI_CONTINUOUS, demand_basis=DemandBasis.TARGET, enable_roads=False, enable_silviculture=False, enable_fleet_investment=False)[source]

Create a tactical MILP bundle from a validated scenario.

Parameters:
Return type:

TacticalOperationalMilpBundle

fhops.model.milp.tactical_operational.build_tactical_operational_model(bundle)[source]

Build the aggregate harvest/system/period MILP.

Variables are generated only for eligible harvest-system options. Activation binaries use the option’s physical area/productivity bounds rather than arbitrary big-M constants.

Parameters:

bundle (TacticalOperationalMilpBundle)

Return type:

ConcreteModel

fhops.model.milp.tactical_operational.solve_tactical_operational_milp(bundle, *, solver='highs', time_limit=None, gap=None, tee=False, solver_options=None)[source]

Build and solve the tactical–operational harvest-allocation MILP.

Returns a dictionary containing solver status, objective decomposition, harvest decisions, product production, transport flows, purchases, inventories, optional module decisions, model dimensions, and build/solve timing statistics.

Parameters:
Return type:

dict[str, Any]

fhops.model.milp.tactical_operational.tactical_bundle_from_dict(payload)[source]

Rebuild a tactical MILP bundle from tactical_bundle_to_dict() output.

Parameters:

payload (Mapping[str, Any])

Return type:

TacticalOperationalMilpBundle

fhops.model.milp.tactical_operational.tactical_bundle_to_dict(bundle)[source]

Serialize a tactical MILP bundle for reproducible replay.

Parameters:

bundle (TacticalOperationalMilpBundle)

Return type:

dict[str, Any]