Skip to content

Framework Example 4: Context Model Index ​

中文

Demo4 is an architecture sample rather than a complete Kotlin application: Application is empty and only Demo4GenericQuantitySample is executable. This index therefore separates context contracts from application wiring. The local model pages below are maintained model prose; data-only and orchestration contexts explicitly document their absence of independent solver variables rather than inventing a global model.

1. Context map ​

text
task + rule + crew + cargo → bunch_generation → bunch_compilation
                                      ↘ bunch_selection (branch-and-price policy)
passenger ───────────────────────────→ bunch_compilation (optional pipelines)

The directed arrows describe data and service dependencies, not a claim that Application registers every context in one model.

2. Context model pages ​

ContextModel boundaryLocal model
taskflight tasks, legs, cycles, aircraft and recovery data; input to generation and compilationtask; no independent optimization model is registered by Application
rulelinks, restrictions, flow control, and feasibility/time/cost calculatorsrule; predicates used by bunch generation
crewcrew members, ranks, schedules, and transit-time datacrew
cargocargo data and capacity/disruption placeholderscargo
passengerpassenger amount, cancellation, class/flight changes and their objective/constraint pipelinespassenger
bunch_generationfeasible bunch/column generation from task/rule/crew/cargo data and shadow pricesbunch generation; generation service, not a standalone master model
bunch_compilationmaster-model column selection, task/flow/fleet/link/capacity expressions and incremental columnsbunch compilation
bunch_selectionbranch-and-price policy, reduced-cost callback and orchestrationbunch selection; algorithm service, no independent variable family

3. Shared notation and master contract ​

Shared symbols (B_k, T, A, L) and generated-column incidence coefficients are defined in the linked context pages. The compilation page is the source of truth for registered variables, slacks, constraints, and objective; this index does not duplicate those formulas.

4. Context boundaries and evidence ​

  1. BunchGenerationContext.generateFlightTaskBunch is the pricing callback. It returns generated bunches for a shadow-price map; it is not a solver constraint.
  2. BunchCompilationContext.register creates the linear meta-model symbols and returns the active pipeline list. A model class that is not returned by that list is not an active assertion.
  3. PassengerContext.register is an independent registration path. It should not be silently folded into the compilation equations unless the caller invokes it.
  4. BranchAndPriceAlgorithm coordinates policy, bounds, reduced costs, and generated columns. It supplies algorithm state, not an additional domain variable family.

The parent page documents the generic-quantity executable and provides Kotlin/Rust source entry points. Use these split pages for context-level vocabulary and formula review, and the source links below for implementation line evidence.

  1. Kotlin Demo4 source
  2. Rust Demo4 source