input_uncertainty_frame¶
Python reference for nagasim.uncertainty.input_uncertainty_frame.
Each KPI's run-to-run interval, its interval with the inputs' uncertainty, and the inputs' share of the spread, as a DataFrame with one row per KPI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layout
|
dict or str
|
The model. |
required |
inputs
|
list of dict
|
|
required |
**kwargs
|
|
{}
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Columns |
See Also
input_uncertainty : The same answer as a nested dict (its released return type, D1322).
Examples:
>>> import random
>>> from nagasim import build as nb, uncertainty
>>> m = nb.Model(time_limit=300, warmup=30)
>>> m.add_resource(name="Server", capacity=1)
'Server'
>>> arrive = m.create("arrive", distribution=nb.Exponential(rate=0.9))
>>> _ = arrive >> m.process("serve", resource_name="Server",
... distribution=nb.Exponential(rate=1.0)) >> m.dispose()
>>> rng = random.Random(0)
>>> gaps = [round(rng.expovariate(0.9), 3) for _ in range(30)]
>>> table = uncertainty.input_uncertainty_frame(
... m.to_dict(), [{"path": "blocks.arrive.params.distribution", "values": gaps}],
... kpis=["system/Total Entities Completed"], resamples=2, replications=2)
>>> list(table.columns)[:3], table.attrs["runs"]
(['kpi', 'mean', 'run_lo'], 6)