Skip to main content

LifecycleTcoScenario

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.

Monthly lifecycle cost in four terms (training, inference, data, iteration), each counted once.

Notes

Equation: Total monthly cost sums the supplied category amounts; shares divide each category by the total.

Assumptions: Categories are mutually exclusive, exhaustive for the chosen accounting boundary, and total cost is positive.

Excludes: Capital discounting and unlisted lifecycle activities.

References

Derivation: Each monthly category is an explicitly supplied, nonoverlapping cost component. Adding those components gives total cost, division by total gives category shares, and comparison in a common currency/time unit identifies the largest component.

Examples

>>> from mlsysim import Scenarios
>>> s = Scenarios.StartupOneModelTco
>>> abs(sum(s.shares.values()) - 1) < 1e-12
True

Attributes

Name Description
dominant Name of the category with the largest monthly USD contribution.
monthly
shares Dimensionless category fractions of the total monthly cost.
total Monthly USD cost summed across the declared lifecycle categories.

Methods

Name Description
ratios_to This budget’s terms (and total) over another’s.

ratios_to

engine.scenario_types.LifecycleTcoScenario.ratios_to(other)

This budget’s terms (and total) over another’s.

Equation: Divide each matching monthly category by the other scenario category; add total / other.total under the total key.

monthly

Type: Dict[str, Quantity].

Declared default: required.

total

engine.scenario_types.LifecycleTcoScenario.total

Monthly USD cost summed across the declared lifecycle categories.

Equation: sum(monthly.values(), Q_(0, 'USD/month')).to('USD/month').

shares

engine.scenario_types.LifecycleTcoScenario.shares

Dimensionless category fractions of the total monthly cost.

Equation: t = total; {k: (v / t).to('').magnitude for k, v in monthly.items()}.

dominant

engine.scenario_types.LifecycleTcoScenario.dominant

Name of the category with the largest monthly USD contribution.

Equation: max(monthly, key=lambda k: monthly[k].to('USD/month').magnitude).

Back to top