Commit 78e83223 authored by Mohcine Chraibi's avatar Mohcine Chraibi

test 2: failed cause of the smooth transition from v0 to v0upstairs

parent 2fe621fe
......@@ -61,7 +61,7 @@
<force_wall nu="0.2" dist_max="3" disteff_max="2" interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.6" sigma="0.0" />
<v0 mu="0.5" sigma="0.0" />
<v0_upstairs mu="0.5" sigma="0.0" />
<v0_downstairs mu="0.65" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
......
#!/usr/bin/env python
"""
1 ped moving on a 10m long stair.
It should be shown that the ped can maintain its speed constant.
Remarque:
========
In JuPedSim pedestrians adapt their velocity
from a corridor to a stair *smoothly* (no step function).
In this test we set v0 == v0Upstairs. Hence, we can avoid any delay related to the transition
from v0 to v0Upstairs.
"""
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
......@@ -10,20 +22,24 @@ from utils import *
def run_rimea_test2(inifile, trajfile):
must_min_time = 19
must_max_time = 21
# pedestrians in force-based models accelerate from 0 to v0 after some time (\tau)
tolerance = 1 # ped accelerates from 0 to v0 after some time (\tau)
v0_upstairs = 0.5 # velocity on stair from master-ini.xml
end_stair = 10.0 # values from geometry.xml
start_stair = 0.0 # values from geometry.xml
must_time = (end_stair - start_stair)/v0_upstairs
fps, n, traj = parse_file(trajfile)
# filter trajecetries. Consider only the stair
traj_stair = traj[0 <= traj[:, 2]]
traj_stair = traj_stair[traj_stair[:, 2] <= 10]
# traj_stair = traj[0 <= traj[:, 2]]
# traj_stair = traj_stair[traj_stair[:, 2] <= 10]
in_stair = (traj[:, 2] >= start_stair) & (traj[:, 2] <= end_stair)
traj_stair = traj[in_stair]
evac_time = (max(traj_stair[:, 1]) - min(traj_stair[:, 1])) / float(fps)
if must_min_time <= evac_time <= must_max_time:
logging.info("evac_time: %f <= %f <= %f", must_min_time, evac_time, must_max_time)
if must_time -tolerance <= evac_time <= must_time + tolerance:
logging.info("evac_time: %f <= %f <= %f",
must_time-tolerance, evac_time, must_time+tolerance)
else:
logging.critical("%s exits with FAILURE. evac_time: %f <= %f <= %f ?",
argv[0], must_min_time, evac_time, must_max_time)
argv[0], must_time-tolerance, evac_time, must_time+tolerance)
exit(FAILURE)
......@@ -37,3 +53,4 @@ if __name__ == "__main__":
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment