CompactionPaybackScenario
Economics scenarios · Implementation: mlsysim/engine/scenario_definitions/economics.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
One compaction of a billed trajectory: a summary resent fresh, then shorter cached reads.
Notes
Equation: The result property delegates to the named solver documented below; it converts declared scenario units before passing the inputs.
Assumptions: One summary replaces the prefix at the supplied turn and the declared summary output cost is charged.
Excludes: Quality loss from compaction, repeated compactions, and provider cache implementation details.
References
Derivation: the scenario composes mlsysim.solvers.CompactionPaybackModel. Their contracts supply the underlying equations; property equations show the remaining unit conversions and accounting.
Examples
>>> from mlsysim import Scenarios
>>> scenario = Scenarios.RepairCompactionPayback
>>> value = scenario.result
>>> type(value).__name__
'CompactionPaybackResult'Attributes
| Name | Description |
|---|---|
| bill | |
| compact_to | |
| compact_turn | |
| result | Return the typed accounting result from CompactionPaybackModel using this scenario’s |
| summary_tokens |
bill
Type: ResendCacheBillScenario.
Declared default: required.
compact_turn
Type: int.
Declared default: required.
compact_to
Type: int.
Declared default: required.
summary_tokens
Type: int.
Declared default: required.
result
engine.scenario_types.CompactionPaybackScenario.result
Return the typed accounting result from CompactionPaybackModel using this scenario’s declared inputs; units and exclusions follow that solver contract.
Equation: CompactionPaybackModel().solve(t.turns, t.first_prompt, t.appended, b.input_price, b.cached_fraction, b.output_price, compact_turn, compact_to, summary_tokens).