ResendCacheBillScenario
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.
An append-only trajectory (TrajectoryResendScenario) billed under one tariff, with and without reuse.
Notes
Equation: The result property delegates to the named solver documented below; it converts declared scenario units before passing the inputs.
Assumptions: The prompt grows append-only and the supplied tariff and miss fraction apply to every turn.
Excludes: Provider-specific cache eligibility rules, expiration, and tokenization differences.
References
Derivation: the scenario composes mlsysim.solvers.PrefixCacheBillModel. Their contracts supply the underlying equations; property equations show the remaining unit conversions and accounting.
Examples
>>> from mlsysim import Scenarios
>>> scenario = Scenarios.RepairResendCacheBill
>>> value = scenario.result
>>> type(value).__name__
'PrefixCacheBillResult'Attributes
| Name | Description |
|---|---|
| cached_fraction | |
| input_price | |
| miss_fraction | |
| output_price | |
| result | Return the typed accounting result from PrefixCacheBillModel using this scenario’s |
| trajectory |
trajectory
Type: TrajectoryResendScenario.
Declared default: required.
input_price
Type: Quantity.
Declared default: required.
cached_fraction
Type: float.
Declared default: required.
output_price
Type: Quantity.
Declared default: required.
miss_fraction
Type: float.
Declared default: required.
result
engine.scenario_types.ResendCacheBillScenario.result
Return the typed accounting result from PrefixCacheBillModel using this scenario’s declared inputs; units and exclusions follow that solver contract.
Equation: PrefixCacheBillModel().solve(t.turns, t.first_prompt, t.appended, t.output_per_turn, input_price, cached_fraction, output_price, miss_fraction).