jupedsim_scenarios.agent_parameters#

Per-agent parameter fields, their settings keys, bounds and overrides.

A spawn area may carry agent_parameter_overrides, shaped {"<model_type>": {"<jupedsim_field>": <number>}}. Only the entry for the active model applies; absent means the area inherits the global settings.

Attributes#

Exceptions#

AgentParameterError

A spawn area's agent parameters are invalid; the run does not start.

Classes#

Bound

Closed or open interval; None means unbounded on that side.

Functions#

active_overrides(params, model_type) → dict[str, float]

Return the area's overrides for model_type; {} when absent.

overriding_area_labels(distributions, model_type, field) → list[str]

Labels of the spawn areas whose model_type overrides set field.

precedence_warning(settings_key, field, labels) → str

Message for a changed default that overriding spawn areas ignore.

settings_key_fields(model_type) → dict[str, str]

Map each settings key of model_type to the field it sets.

validate_agent_parameters(data, model_type, global_params) → None

Reject invalid agent parameters of every spawn area before placement.

Module Contents#

exception AgentParameterError[source]#

Bases: ValueError

A spawn area’s agent parameters are invalid; the run does not start.

class Bound[source]#

Closed or open interval; None means unbounded on that side.

hi: float | None[source]#
hi_open: bool[source]#
lo: float | None[source]#
lo_open: bool[source]#
active_overrides(params: dict, model_type: str) → dict[str, float][source]#

Return the area’s overrides for model_type; {} when absent.

overriding_area_labels(distributions, model_type: str, field: str) → list[str][source]#

Labels of the spawn areas whose model_type overrides set field.

precedence_warning(settings_key: str, field: str, labels: list[str]) → str[source]#

Message for a changed default that overriding spawn areas ignore.

settings_key_fields(model_type: str) → dict[str, str][source]#

Map each settings key of model_type to the field it sets.

validate_agent_parameters(data: dict, model_type: str, global_params) → None[source]#

Reject invalid agent parameters of every spawn area before placement.

Covers explicit overrides and inherited settings alike, because each per-agent field is resolved and its effective value is bounds-checked. Raises AgentParameterError naming the area, model and field.

FIELD_BOUNDS: dict[str, dict[str, Bound]][source]#
OVERRIDES_KEY = 'agent_parameter_overrides'[source]#
PER_AGENT_FIELDS: dict[str, dict[str, tuple[tuple[str, ...], float]]][source]#