How do I change the agents’ walking speed?#
set_agent_params(distribution_id, **kwargs) updates parameters on a
distribution — radius, speed, distribution shape, flow timing, etc.
For walking speed, use desired_speed=. The legacy v0= keyword still
works but now emits a DeprecationWarning and will be removed in a future release.
import logging
from datetime import datetime
# Silence jupedsim-scenarios' INFO/DEBUG output. See the howto
# "How do I inspect a scenario?" for the full list of levels.
logging.getLogger("jupedsim_scenarios").setLevel(logging.WARNING)
print(f"Executed on {datetime.now().strftime('%d.%m.%Y, %H:%M')}")
from jupedsim_scenarios import load_scenario, run_scenario
scenario = load_scenario("../assets/bottleneck.zip")
scenario.set_agent_params(0, desired_speed=1.5) # m/s
result = run_scenario(scenario, seed=42)
print("evacuation time:", result.evacuation_time, "s")
result.cleanup()
Executed on 21.07.2026, 09:42
evacuation time: 51.57 s
1
Other useful keys#
Supported on set_agent_params:
desired_speed(canonical; legacy aliasv0is deprecated)desired_speed_std(canonical; legacy aliasv0_stdis deprecated)desired_speed_distribution—"constant"or"gaussian"(legacy aliasv0_distributionis deprecated)radius,radius_distribution,radius_stdnumber,distribution_modeuse_flow_spawning,flow_start_time,flow_end_time
Example with a gaussian speed distribution:
scenario.set_agent_params(
0,
desired_speed=1.34,
desired_speed_std=0.20,
desired_speed_distribution="gaussian",
)