Commit 04010ebb authored by Mohcine Chraibi's avatar Mohcine Chraibi

Fixed Test 13

parent 60ddc070
......@@ -58,9 +58,9 @@ class JPSRunTestDriver(object):
self.__configure()
executable = self.__find_executable()
results = []
for inifile in self.inifiles:
res = self.__execute_test(executable, inifile, testfunction, *args)
results.append(res)
for inifile in self.inifiles: fzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
RES = SELF.__EXECUTE_TEST(EXECUTABLE, INIFILE, testfunction, *args)
resu mnvvvvvvvvvvvvvvvvvvf lts.append(res)
return results
def __configure(self):
......@@ -134,3 +134,4 @@ class JPSRunTestDriver(object):
......@@ -6,7 +6,7 @@
<!-- seed used for initialising random generator -->
<seed>linspace(0, 1000, 10)</seed>
<max_sim_time>500</max_sim_time>
<max_sim_time>1000</max_sim_time>
<!-- geometry file -->
<geometry>../geometry.xml</geometry>
<!-- trajectories file and format -->
......@@ -57,11 +57,12 @@
<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="0.2" dist_max="3" disteff_max="2" interpolation_width="0.1" />
<force_wall nu="0.35" dist_max="3" disteff_max="2" interpolation_width="0.1" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="1.3" sigma="0.2" />
<v0_upstairs mu="0.9" sigma="0.2" />
<!-- For stair speed see tab 1 in (Burghardt2014) -->
<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" />
......@@ -84,11 +85,12 @@
<stepsize>0.01</stepsize>
<exit_crossing_strategy>3</exit_crossing_strategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="3" b="0.25" c="3.0"/>
<force_wall nu="10" b="0.70" c="3.0"/>
<force_ped nu="1" b="0.034" c="2.451"/>
<force_wall nu="2" b="0.05" c="2.451"/>
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.05" />
<v0 mu="1.3" sigma="0.05" />
<v0_upstairs mu="0.9" sigma="0.05" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
......
#!/usr/bin/env python
"""
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 |
|----------+----------------|
| PM | 0.63 m/s |
| WM | 0.61 m/s |
| NM | 0.8 m/s |
| FM | 0.55 m/s |
|----------+----------------|
Therefore, we choose for v0_upstairs a Gauss-distribution with
mean = 0.675 and sigma = 0.04
See also Fig. DistributionSpeedStairUp.png
"""
import os
import sys
import matplotlib.pyplot as plt
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......@@ -9,25 +26,45 @@ from utils import *
tolerance = 0.05
def eval_results(results):
results = np.array(results)
mean_cor = np.mean(results[:, 0])
mean_stair = np.mean(results[:, 1])
std_cor = np.std(results[:, 0])
std_stair = np.std(results[:, 1])
logging.info("mean corridor: %.2f (+- %.2f), mean stair: %.2f (+- %.2f)",
mean_cor, std_cor, mean_stair, std_stair)
# plt.plot(results[:, 0], "-", lw=2, label="Flow corridor")
# plt.plot(results[:, 1], "-", lw=2, label="Flow stair")
plt.errorbar(range(len(results[:, 0])), results[:, 0],
yerr=std_cor, fmt='-o', lw=2, label="Flow corridor")
plt.errorbar(range(len(results[:, 1])), results[:, 1],
yerr=std_stair, fmt='-D', lw=2, label="Flow stair")
plt.ylabel("$J$", size=18)
plt.xlim([-0.5, len(results[:, 0])+0.5])
plt.xlabel("# runs")
plt.legend(loc="best")
plt.savefig("flow.png")
if abs(mean_cor-mean_stair) < tolerance:
logging.critical("%s exists with FAILURE. Flows are almost equal:", argv[0])
exit(FAILURE)
def run_rimea_test13(inifile, trajfile):
fps, N, traj = parse_file(trajfile)
exit_basement = 0
start_stair = 12
J_corridor = flow(fps, N, traj, exit_basement)
J_stair = flow(fps, N, traj, start_stair)
if abs(J_corridor-J_stair) < tolerance:
logging.critical("%s exists with FAILURE. Flows are almost equal:", argv[0])
logging.critical("J_corridor = %.2f, J_stair = %.2f (tolerance = %.2f)",
J_corridor, J_stair, tolerance)
exit(FAILURE)
else:
logging.info("J_corridor = %.2f, J_stair = %.2f (tolerance = %.2f)",
J_corridor, J_stair, tolerance)
logging.info("J_corridor = %.2f, J_stair = %.2f (tolerance = %.2f)",
J_corridor, J_stair, tolerance)
return (J_corridor, J_stair)
if __name__ == "__main__":
test = JPSRunTestDriver(13, argv0=argv[0], testdir=sys.path[0], utestdir=utestdir)
test.run_test(testfunction=run_rimea_test13)
results = test.run_test(testfunction=run_rimea_test13)
eval_results(results)
logging.info("%s exits with SUCCESS" % (argv[0]))
exit(SUCCESS)
......@@ -39,3 +76,5 @@ 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