checks¶
Python reference for nagasim.laws.checks.
Every computable law and guardrail for one run (see the module docstring).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layout
|
dict
|
The model as run; its |
required |
results
|
dict
|
The frames of the run, from |
required |
warmup
|
float
|
The warm-up the run really used, when it is not the model's. |
None
|
Returns:
| Type | Description |
|---|---|
list of dict
|
One |
See Also
nagasim.laws.of_run : The same checks summarised for runs already made.
Examples:
>>> import json
>>> from pathlib import Path
>>> import nagasim
>>> from nagasim import api, laws
>>> path = Path(nagasim.__file__).parent / "models" / "single_server.json"
>>> layout = json.loads(path.read_text(encoding="utf-8"))
>>> results = api.run_model(layout, replications=1, run_length=200, warmup=20, seed=0)
>>> checks = laws.checks(layout, results)
>>> [c["law"] for c in checks]
['utilisation', 'little (resource)', 'censoring']
>>> sorted(checks[0])
['law', 'name', 'verdict', 'why']