forecast¶
Python reference for nagasim.forecast.forecast.
Run a short terminating horizon from the system's current state.
There is no warm-up: a forecast is about the transient from the initial state, which a warm-up would discard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layout
|
dict or str
|
The model, with its |
required |
horizon
|
float
|
Run length in base time units. |
required |
replications
|
int
|
Replications behind each band. |
100
|
kpis
|
list of str
|
Narrows the end-of-horizon table (default: every KPI, including the
|
None
|
events
|
sequence of dict
|
|
()
|
bind_data
|
bool
|
Resolve the model's data bindings once before the replications, so the run uses today's parameters. |
True
|
base_dir
|
optional
|
As in |
None
|
network
|
optional
|
As in |
None
|
confine_to
|
optional
|
As in |
None
|
seed
|
int
|
Seed of replication 0. |
0
|
workers
|
int or 'auto'
|
Process-pool size. |
1
|
confidence
|
float
|
Level of the intervals. |
0.95
|
quantiles
|
tuple of float
|
The band's lower and upper quantile. |
(0.05, 0.95)
|
on_progress
|
callable
|
As in |
None
|
should_stop
|
callable
|
As in |
None
|
Returns:
| Type | Description |
|---|---|
ForecastResult
|
The end-of-horizon |
See Also
nagasim.api.run_model : A steady-state run, with a warm-up.
Examples:
>>> from pathlib import Path
>>> import nagasim
>>> from nagasim.forecast import forecast
>>> path = Path(nagasim.__file__).parent / "models" / "single_server.json"
>>> result = forecast(str(path), horizon=50, replications=5, seed=0)
>>> result.horizon, result.replications
(50.0, 5)