Skip to main content

ConservedBudgetScenario

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.

A root budget granted to two children; the second stops with a remote job billed late.

Notes

Equation: The result property delegates to the named solver documented below; it converts declared scenario units before passing the inputs.

Assumptions: Money is converted to integer milli-USD; parent and child accounts follow the solver settlement convention.

Excludes: Currency exchange, sub-milli-USD precision, and guarantees about an external billing service.

References

Derivation: the scenario composes mlsysim.solvers.ConservedBudgetModel. Their contracts supply the underlying equations; property equations show the remaining unit conversions and accounting.

Examples

>>> from mlsysim import Scenarios
>>> scenario = Scenarios.RepairBudgetLateBill
>>> value = scenario.result
>>> type(value).__name__
'ConservedBudgetResult'

Attributes

Name Description
allocations
budget
deliveries
late_charge
pending
planning
result Return the typed accounting result from ConservedBudgetModel using this scenario’s
settled_children

budget

Type: Quantity.

Declared default: required.

planning

Type: Quantity.

Declared default: required.

allocations

Type: List[Quantity].

Declared default: required.

settled_children

Type: List[Quantity].

Declared default: required.

pending

Type: Quantity.

Declared default: required.

late_charge

Type: Quantity.

Declared default: required.

deliveries

Type: int.

Declared default: 2.

result

engine.scenario_types.ConservedBudgetScenario.result

Return the typed accounting result from ConservedBudgetModel using this scenario’s declared inputs; units and exclusions follow that solver contract.

Equation: ConservedBudgetModel().solve(m(budget), m(planning), [m(x) for x in allocations], [m(x) for x in settled_children], m(pending), m(late_charge), deliveries); otherwise int(round(float(q.to('USD').magnitude) * 1000)).

Back to top