Commit b0ec8fab authored by Mohcine Chraibi's avatar Mohcine Chraibi

Add documentation of rimea tests

parent 78e83223
#!/usr/bin/env python
"""
Test description
================
One pedestrian is moving along a corridor.
Test if pedestrian can maintain its speed constant
Remarks
=======
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdfs
"""
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
......@@ -35,3 +49,4 @@ if __name__ == "__main__":
#!/usr/bin/env python
"""
Test description
================
- Pedestrians are distributed in 12 different rooms.
- The building has two exits.
- The Pedestrians have exactly assigned exit numbers and should evacuate through these.
Remarks
=======
- We assign pedestrian to two different groups
- We check if pedestrians in the two groups pass the exits.
- In the simulation pedestrians disapear once they are outside
therefore we check if peds go through line <exit> - <displacement>
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
......@@ -7,8 +25,7 @@ sys.path.append(utestdir)
from JPSRunTest import JPSRunTestDriver
from utils import *
displacement = 1 # in the simulation pedestrians disapear once they are outside
# therefore we check if peds go through line <exit> - <displacement>
displacement = 1
def run_rimea_test10(inifile, trajfile):
......@@ -57,3 +74,4 @@ if __name__ == "__main__":
#!/usr/bin/env python
"""
Test description
================
300 pedestrians are distributed in a room with two exits.
The pedestrians should prefer the nearest exit,
but some should (spontaneously) choose the second exit
Remarks
=======
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
......@@ -42,3 +57,4 @@ if __name__ == "__main__":
#!/usr/bin/env python
"""
Test description
================
Two bottlenecks are connected with a long corridor.
At the last exit there should be no jam.
Remarks
=======
condition of this test is not clear enough...
In the last exit there should be no jam. Means:
J_botl >= J_last
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
......@@ -11,11 +28,6 @@ tolerance = 0.05
displacement = 1 # in the simulation pedestrians disapear once they are outside
# therefore we measure the last flow at a <last_exit> - <displacement>
def run_rimea_test12(inifile, trajfile):
"""
condition of this test is not clear enough...
In the last exit there should be no jam. Means:
J_botl >= J_last
"""
fps, N, traj = parse_file(trajfile)
exit_botl = [19.13, -0.55, 0.45]
last_exit = [29.13 - displacement, -0.55, 0.45]
......@@ -46,3 +58,4 @@ if __name__ == "__main__":
Utest/rimea_tests/test_13/flow.png

50.5 KB | W: | H:

Utest/rimea_tests/test_13/flow.png

41.7 KB | W: | H:

Utest/rimea_tests/test_13/flow.png
Utest/rimea_tests/test_13/flow.png
Utest/rimea_tests/test_13/flow.png
Utest/rimea_tests/test_13/flow.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -43,7 +43,7 @@
<!--persons information and distribution -->
<agents operational_model_id="1">
<agents_distribution>
<group group_id="0" agent_parameter_id="1" room_id="0" subroom_id="0" goal_id="-1" number="150" router_id="1" x_max="-2" x_min="-5" />
<group group_id="0" agent_parameter_id="1" room_id="0" subroom_id="0" goal_id="-1" number="150" router_id="1" x_max="-1" x_min="-4" y_max="4" y_min="-3.5" />
</agents_distribution>
</agents>
......@@ -57,15 +57,16 @@
<exit_crossing_strategy>4</exit_crossing_strategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="0.3" dist_max="3" disteff_max="2" interpolation_width="0.1" />
<force_wall nu="1.35" dist_max="5" disteff_max="2" interpolation_width="0.1" />
<force_wall nu="0.3" dist_max="4" disteff_max="2" interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="1.3" sigma="0.2" />
<v0 mu="1.3" sigma="0.04" />
<!-- For stair speed see tab 1 in (Burghardt2014) -->
<!-- <v0_upstairs mu="0.675" sigma="0.04" /> -->
<v0_upstairs mu="0.675" sigma="0.04" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<bmax mu="0.20" sigma="0.001" />
<bmin mu="0.15" sigma="0.001" />
<amin mu="0.15" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
......@@ -85,8 +86,8 @@
<stepsize>0.01</stepsize>
<exit_crossing_strategy>3</exit_crossing_strategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="1" b="0.034" c="2.451"/>
<force_wall nu="2" b="0.05" c="2.451"/>
<force_ped nu="0.6" b="0.034" c="2.451"/>
<force_wall nu="3" b="0.034" c="2.451"/>
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="1.3" sigma="0.05" />
......
#!/usr/bin/env python
"""
Flow at the beginnning of the stair should be smaller than the flow in the corridor.
Test description
================
Pedestrian coming out from a bottleneck along a corridor.
At the end of the corridor is a stair.
Since peds have to resduce their speed on the stair,
a jam should be observed at the beginning of the stair
Remarks
=======
In case of jam, flow at the beginnning of the stair
should be smaller than the flow in the corridor.
The reduced speed on stairs (up) is according to Tab 1 Burghardt2014:
|----------+----------------|
| Handbook | Speed Stair Up |
......@@ -14,7 +25,12 @@ The reduced speed on stairs (up) is according to Tab 1 Burghardt2014:
Therefore, we choose for v0_upstairs a Gauss-distribution with
mean = 0.675 and sigma = 0.04
See also Fig. DistributionSpeedStairUp.png
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
import matplotlib.pyplot as plt
......@@ -78,3 +94,4 @@ if __name__ == "__main__":
#!/usr/bin/env python
"""
Test description
================
Pedestrian evacuation to an exit. They have two possible routes:
1. short
2. and long
Remarks
=======
This test has no concrete condition to check for.
It should be documented whether pedestrians take a long detour or not
There are 4 stats that should be documented:
1. "kurz" (short)
2. "lang" (long)
3. "gemischt" (mixed)
4. "konfigurierbar" (configurable)
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
......@@ -9,13 +31,7 @@ from utils import *
"""
This test has no concrete condition to check for.
It should be documented whether pedestrians take a long detour or not
There are 4 stats that should be documented:
1. "kurz" (short)
2. "lang" (long)
3. "gemischt" (mixed)
4. "konfigurierbar" (configurable)
"""
states = ["short", "long", "mixed", "configurable"]
......@@ -57,3 +73,4 @@ if __name__ == "__main__":
#!/usr/bin/env python
"""
Test Description
================
1 ped moving on a 10m long stair.
It should be shown that the ped can maintain its speed constant.
Remarque:
Remarks:
========
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.
Source:
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdfs
"""
import os
......@@ -54,3 +60,4 @@ if __name__ == "__main__":
......@@ -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.65" 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
"""
Test Description
================
1 ped moving on a 10m long stair *downstairs*
It should be shown that the ped can maintain its speed constant.
Remarks:
========
In JuPedSim pedestrians adapt their velocity
from a corridor to a stair *smoothly* (no step function).
In this test we set v0 == v0Downstairs. Hence, we can avoid any delay related to the transition
from v0 to v0Downstairs.
Source:
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdfs
"""
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
......@@ -10,20 +28,24 @@ from utils import *
def run_rimea_test3(inifile, trajfile):
must_min_time = 14
must_max_time = 16
tolerance = 1 # ped accelerates from 0 to v0 after some time (\tau)
v0_downstairs = 0.65 # 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_downstairs
# pedestrians in force-based models accelerate from 0 to v0 after some time (\tau)
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]
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)
......@@ -38,3 +60,4 @@ if __name__ == "__main__":
"""
Test description
================
Fundamental diagram in a corridor with closed boundary conditions
Remarks
=======
No boundary conditions in JuPedSim yet.
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
#!/usr/bin/env python
"""
Test description
================
Distribute 10 pedestrians with 10 different reaction times.
Check whether they start exactly at the specified times.
Remarks
=======
An error of 1/fps is to be considered.
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
import numpy as np
......@@ -62,3 +78,4 @@ if __name__ == "__main__":
logging.info("%s exits with SUCCESS" % (argv[0]))
exit(SUCCESS)
#!/usr/bin/env python
"""
Test description
================
20 pedestrians going around a corner.
Remarks
=======
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
import numpy as np
......@@ -41,3 +54,4 @@ if __name__ == "__main__":
This diff is collapsed.
#!/usr/bin/env python
"""
Test description
================
Distribute pedestrian's speed according to Tab. P. 6
4 different groups are distributed
1. v<30
2. 30<v<50
3. v>50
4. handicapted
Check whether the speed values are within the specified fange.
Remarks
=======
1. The velocities are assumed to be constant and are therefor averaged: v = DX/DT.
2. The ped-ped repulsive forces are intentionally set to zero, since in diesem
Test we are interested only in the desired velocies.
Some error messages could result (overlapping)
3. Script Gauss.py checks that the sigmas, means are in accordance with the min-max values in Tab. 1
This test produces two files
1. a png-file showing the distribution of the velocities
2. a csv-file with two comma separated columns: ids, velocities
@todo: write csv-file to excel as in the rimea reports
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
import numpy as np
......@@ -9,30 +42,7 @@ sys.path.append(utestdir)
from JPSRunTest import JPSRunTestDriver
from utils import *
__author__ = "chraibi"
"""
This test produces two files
1. a png-file showing the distribution of the velocities
2. a csv-file with two comma separated columns: ids, velocities
Remarques
=========
1. The velocities are assumed to be constant and are therefor averaged: v = DX/DT.
2. The ped-ped repulsive forces are intentionally set to zero, since in diesem
Test we are interested only in the desired velocies. Some error messages could result (overlapping)
3. Script Gauss.py checks that the sigmas, means are in accordance with the min-max values in Tab. 1
@todo: write csv-file to excel as in the rimea reports
Rimea tests:
http://www.rimea.de/fileadmin/files/dok/analyse/Analyse_FDS_Evac_20080603_optimiert_files.pdf
"""
# ================ Tab. P. 6
# source: http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
# Group 1, 2, 3, 4
weidman_max_vel = np.array([1.61, 1.54, 1.41, 0.76])
weidman_min_vel = np.array([0.58, 1.41, 0.68, 0.46])
......@@ -98,3 +108,4 @@ if __name__ == "__main__":
#!/usr/bin/env python
"""
Test description
================
A 3D building is simulated and the influence of parameter e.g. speed
is investigated. It should be shown how the evacuation time behaves with respect
to the investigated parameter.
Remarks
=======
Test not running in JuPedSim.
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
......@@ -25,3 +41,4 @@ if __name__ == "__main__":
#!/usr/bin/env python
"""
Test description
================
1000 pedestrians are distributed in a room with 4 exits.
scenario 1: All 4 exits are open
scenario 2: 2 exits are closed. The remaining 2 are still open
The flow should nearly be doubled in scenario 1.
Remarks
=======
For simplicity we simulate two identical rooms:
1. room left: with 4 exits. All of them are open
2. room right with 4 exits. two of them are closed
3. We write the trajectory in plain txt-format, to avoid a long lasting xml-parsing
Source
======
http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
"""
import os
import sys
import matplotlib.pyplot as plt
......@@ -10,11 +30,6 @@ sys.path.append(utestdir)
from JPSRunTest import JPSRunTestDriver
from utils import *
"""
For simplicity we simulate two identical rooms:
1. room left: with 4 exits. All of them are open
2. room right with 4 exits. two of them are closed
"""
# ==================== todo: read these variables from the geometry.xml
r1_left = 0
r1_right = 30
......@@ -91,3 +106,4 @@ if __name__ == "__main__":
......@@ -379,8 +379,10 @@ double Pedestrian::GetV0Norm() const
double delta = nav_elevation - ped_elevation;
// const Point& pos = GetPos();
// fprintf(stderr, "%f %f %f %f\n", pos.GetX(), pos.GetY(), sub->GetElevation(_ellipse.GetCenter()), 2.0/(1+exp(-9.0*ped_elevation*ped_elevation)));
// printf("delta = %f, nav_elev = %f, ped_elev= %f\n", delta, nav_elevation, ped_elevation);
// we are walking on an even plane
// we are walking on an even plane
//TODO: move _ellipse.GetV0() to _V0Plane
if(fabs(delta)<J_EPS){
return _ellipse.GetV0();
......@@ -391,11 +393,14 @@ double Pedestrian::GetV0Norm() const
double f = 2.0/(1+exp(-c*ped_elevation*ped_elevation)) - 1; // f in [0, 1]
if(delta<0)
{
// printf("z=%f, f=%f, v0=%f, v0d=%f, ret=%f\n", ped_elevation, f, _ellipse.GetV0(), _V0DownStairs, (1-f)*_V0DownStairs + f*_ellipse.GetV0());
// getc(stdin);
return (1-f)*_V0DownStairs + f*_ellipse.GetV0();
}
//we are walking upstairs
else
{
{
return (1-f)*_ellipse.GetV0() + f*_V0UpStairs;
}
}
......
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