Simulation options
Use SimulationOptions to configure numerical and analysis choices while the
simulation is OPEN or ENDED. Individual assignments and
options.update(**changes) use the same atomic native update. Rust checks each
value locally, retains the complete requested configuration, and records what
needs preparation. The effective solver fields wait until start().
This gives you room to edit related values in several calls. A schedule or step
relationship can be temporarily inconsistent while you work. Reads return your
requested values, including after a failed start. At start(), the solver
prepares effective defaults, step coupling, flags, threads, and dependent
hydraulic geometry, then installs them together if preparation succeeds.
If preparation fails, start() raises ConfigurationError with ordered
diagnostics and leaves the prior effective state intact. Repair the requested
values and retry. requested_threads is what you asked for;
simulation.effective_threads is the prepared worker count.
Assigning custom_ellipse_model while OPEN or ENDED marks configuration
dirty. The next start() revalidates and atomically rebuilds affected cross sections.
Update related dates together with Simulation.update_schedule(**changes).
Omitted dates keep their requested values. The setter checks that dates are
finite and representable. At start(), the solver checks start/end ordering,
positive duration, whether the report start falls at or after the end, and
report step coupling. A report start earlier than the requested start is normalized
to the effective start instead of producing a diagnostic. Direct date setters
use the same operation.
from datetime import datetime, timedelta
simulation.options.update(
routing_step=timedelta(seconds=20),
courant_factor=1.0,
requested_threads=2,
)
simulation.update_schedule(
start_time=datetime(2025, 1, 1),
report_start=datetime(2025, 1, 1, 1),
end_time=datetime(2025, 1, 2),
)
Typed, generation-bound views over configured SWMM project objects.
All view instances retain the simulation and project generation that created them. They validate that identity before accessing native state, so retained views cannot silently address a subsequently reopened project.
| CLASS | DESCRIPTION |
|---|---|
SimulationOptions |
Expose typed numerical and analysis policy for one Project Generation. |
SimulationOptions
Expose typed numerical and analysis policy for one Project Generation.
Notes
Duration options use datetime.timedelta. Native Rust owns extraction,
local validation, declaration commits, deferred preparation, lifecycle, and
atomic effective-state commit. Requested values remain readable while the
owner is dirty; effective normalization occurs at Simulation.start().
| METHOD | DESCRIPTION |
|---|---|
update |
Atomically update mutable simulation policy fields. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
allow_ponding |
Setter lifecycle:
TYPE:
|
antecedent_dry_duration |
Setter lifecycle:
TYPE:
|
courant_factor |
Setter lifecycle:
TYPE:
|
custom_ellipse_model |
Hydraulic model for custom ellipses. Setter lifecycle:
TYPE:
|
detailed_reporting_enabled |
Setter lifecycle:
TYPE:
|
groundwater_enabled |
Setter lifecycle:
TYPE:
|
head_tolerance |
Return the dynamic-wave head-convergence tolerance in length units.
TYPE:
|
inertia_damping |
Setter lifecycle:
TYPE:
|
lateral_flow_tolerance |
Return the lateral-flow continuity tolerance as a percent.
TYPE:
|
lengthening_step |
Setter lifecycle:
TYPE:
|
maximum_routing_step |
Return the effective maximum routing step as a duration.
TYPE:
|
maximum_trials |
Setter lifecycle:
TYPE:
|
minimum_conduit_slope |
Setter lifecycle:
TYPE:
|
minimum_routing_step |
Setter lifecycle:
TYPE:
|
minimum_surface_area |
Setter lifecycle:
TYPE:
|
normal_flow_limit |
Setter lifecycle:
TYPE:
|
quality_enabled |
Setter lifecycle:
TYPE:
|
rainfall_enabled |
Setter lifecycle:
TYPE:
|
rdii_enabled |
Setter lifecycle:
TYPE:
|
report_step |
Setter lifecycle:
TYPE:
|
requested_threads |
Setter lifecycle:
TYPE:
|
routing_enabled |
Setter lifecycle:
TYPE:
|
routing_step |
Setter lifecycle:
TYPE:
|
rule_step |
Setter lifecycle:
TYPE:
|
skip_steady_state |
Setter lifecycle:
TYPE:
|
snowmelt_enabled |
Setter lifecycle:
TYPE:
|
surcharge_method |
Setter lifecycle:
TYPE:
|
sweep_end |
Setter lifecycle: |
sweep_start |
Setter lifecycle: |
system_flow_tolerance |
Return the system-flow continuity tolerance as a percent.
TYPE:
|
antecedent_dry_duration
property
writable
antecedent_dry_duration: timedelta
Setter lifecycle: OPEN, ENDED.
custom_ellipse_model
property
writable
custom_ellipse_model: CustomEllipseModel
Hydraulic model for custom ellipses. Setter lifecycle: OPEN, ENDED.
detailed_reporting_enabled
property
writable
detailed_reporting_enabled: bool
Setter lifecycle: OPEN, ENDED.
head_tolerance
property
head_tolerance: float
Return the dynamic-wave head-convergence tolerance in length units.
lateral_flow_tolerance
property
lateral_flow_tolerance: float
Return the lateral-flow continuity tolerance as a percent.
maximum_routing_step
property
maximum_routing_step: timedelta
Return the effective maximum routing step as a duration.
minimum_routing_step
property
writable
minimum_routing_step: timedelta
Setter lifecycle: OPEN, ENDED.
normal_flow_limit
property
writable
normal_flow_limit: NormalFlowLimit
Setter lifecycle: OPEN, ENDED.
system_flow_tolerance
property
system_flow_tolerance: float
Return the system-flow continuity tolerance as a percent.