Commit 16bce738 authored by Mohcine Chraibi's avatar Mohcine Chraibi

Test 11 use jpscore statistics

parent b0ec8fab
......@@ -257,13 +257,13 @@
</rooms>
<transitions>
<transition id="0" caption="main exit" type="emergency"
<transition id="0" caption="exit_1" type="emergency"
room1_id="0" subroom1_id="12" room2_id="-1" subroom2_id="-1">
<vertex px="6.0" py="11.0" />
<vertex px="7.2" py="11.0" />
</transition>
<transition id="1" caption="main exit" type="emergency"
<transition id="1" caption="exit_2" type="emergency"
room1_id="0" subroom1_id="12" room2_id="-1" subroom2_id="-1">
<vertex px="18.0" py="5.0" />
<vertex px="18.0" py="6.0" />
......
......@@ -75,3 +75,4 @@ if __name__ == "__main__":
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<geometry version="0.5" caption="second life" unit="m"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../xsd/jps_geometry.xsd">
<rooms>
<room id="0" caption="hall">
<subroom id="0" closed="0" class="subroom">
<polygon caption="wall">
<vertex px="28.0" py="20.0" />
<vertex px="30.0" py="20.0" />
<vertex px="30.0" py="0.0" />
<vertex px="0.0" py="0.0" />
<vertex px="0.0" py="20.0" />
<vertex px="21.0" py="20.0" />
</polygon>
<polygon caption="wall_doors">
<vertex px="22.0" py="20.0" />
<vertex px="27.0" py="20.0" />
</polygon>
</subroom>
</room>
</rooms>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../xsd/jps_geometry.xsd">
<rooms>
<room id="0" caption="hall">
<subroom id="0" closed="0" class="subroom">
<polygon caption="wall">
<vertex px="28.0" py="20.0" />
<vertex px="30.0" py="20.0" />
<vertex px="30.0" py="0.0" />
<vertex px="0.0" py="0.0" />
<vertex px="0.0" py="20.0" />
<vertex px="21.0" py="20.0" />
</polygon>
<polygon caption="wall_doors">
<vertex px="22.0" py="20.0" />
<vertex px="27.0" py="20.0" />
</polygon>
<!-- <polygon caption="wall_doors2"> -->
<!-- <vertex px="21.0" py="20.0" /> -->
<!-- <vertex px="21.0" py="20.5" /> -->
<!-- </polygon> -->
<!-- <polygon caption="wall_doors3"> -->
<!-- <vertex px="22.0" py="20.0" /> -->
<!-- <vertex px="22.0" py="20.5" /> -->
<!-- </polygon> -->
<!-- <polygon caption="wall_doors4"> -->
<!-- <vertex px="27.0" py="20.0" /> -->
<!-- <vertex px="27.0" py="20.5" /> -->
<!-- </polygon> -->
<!-- <polygon caption="wall_doors5"> -->
<!-- <vertex px="28.0" py="20.0" /> -->
<!-- <vertex px="28.0" py="20.5" /> -->
<!-- </polygon> -->
</subroom>
</room>
</rooms>
<transitions>
<!-- exits like crossings but between rooms or to outside (room with index
= -1) -->
<transition id="0" caption="main exit 1" type="emergency"
room1_id="0" subroom1_id="0" room2_id="-1" subroom2_id="-1">
<vertex px="21.0" py="20.0" />
<vertex px="22.0" py="20.0" />
</transition>
<transition id="1" caption="main exit 2" type="emergency"
room1_id="0" subroom1_id="0" room2_id="-1" subroom2_id="-1">
<vertex px="27.0" py="20.0" />
<vertex px="28.0" py="20.0" />
</transition>
</transitions>
<transitions>
<!-- exits like crossings but between rooms or to outside (room with index
= -1) -->
<transition id="0" caption="exit_1" type="emergency"
room1_id="0" subroom1_id="0" room2_id="-1" subroom2_id="-1">
<vertex px="21.0" py="20.0" />
<vertex px="22.0" py="20.0" />
</transition>
<transition id="1" caption="exit_2" type="emergency"
room1_id="0" subroom1_id="0" room2_id="-1" subroom2_id="-1">
<vertex px="27.0" py="20.0" />
<vertex px="28.0" py="20.0" />
</transition>
</transitions>
</geometry>
......@@ -6,6 +6,7 @@
<!-- seed used for initialising random generator -->
<seed>1254</seed>
<show_statistics>true</show_statistics>
<max_sim_time>500</max_sim_time>
<!-- geometry file -->
<geometry>../geometry.xml</geometry>
......@@ -26,11 +27,11 @@
<goals>
<goal id="0" final="true" caption="goal 0">
<polygon>
<vertex px="27.0" py="20.5" />
<vertex px="27.5" py="20.5" />
<vertex px="27.5" py="21.0" />
<vertex px="27.0" py="21.0" />
<vertex px="27.0" py="20.5" />
<vertex px="25.0" py="24.5" />
<vertex px="25.5" py="24.5" />
<vertex px="25.5" py="25.0" />
<vertex px="25.0" py="25.0" />
<vertex px="25.0" py="24.5" />
</polygon>
</goal>
</goals>
......@@ -108,6 +109,7 @@
</router> -->
<router router_id="1" description="quickest">
<parameters>
<navigation_mesh method="triangulation" use_for_local_planning="true" />
</parameters>
</router>
......
......@@ -16,33 +16,35 @@ http://www.rimea.de/fileadmin/files/dok/richtlinien/r2.2.1.pdf
import os
import sys
import glob
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
from JPSRunTest import JPSRunTestDriver
from utils import *
import warnings
def run_rimea_test11(inifile, trajfile):
fps, N, traj = parse_file(trajfile)
exit_right = [20, 27, 28] # y, x1, x2
peds = np.unique(traj[:, 0])
total_peds = len(peds)
passed_peds = 0
for ped in peds:
traj1 = traj[traj[:, 0] == ped]
if PassedLineY(traj1, exit_right):
logging.info("ped %d exits from Exit (%1.2f, %1.2f) | (%1.2f, %1.2f)"%
(ped, exit_right[1], exit_right[0], exit_right[2], exit_right[0]))
passed_peds += 1
if passed_peds == 0:
logging.critical("%s exists with failure! 0 peds passed through right exit"%argv[0])
files = glob.glob("trajectories/*_exit*")
if len(files) == 0:
logging.critical("%s exists with failure! Found no exit-files.", argv[0])
exit(FAILURE)
else:
logging.info("[%d/%d] pedestrians passed through right exit!", passed_peds, total_peds)
for f in files:
print f
with warnings.catch_warnings():
warnings.simplefilter("ignore")
d = np.loadtxt(f)
if len(d) == 0:
logging.critical("File %s is empty", f)
logging.critical("%s exists with failure!", argv[0])
exit(FAILURE)
num_evacuated = max(d[:, 1]) # >0 ?
logging.info("%d peds evacuated from exit <%s>",
num_evacuated, f.split("_id_exit_")[1].split(".dat")[0])
if __name__ == "__main__":
......@@ -58,3 +60,5 @@ if __name__ == "__main__":
......@@ -10,6 +10,7 @@ Remarks
condition of this test is not clear enough...
In the last exit there should be no jam. Means:
J_botl >= J_last
However, this condition is not enough to quantify a jam.
Source
======
......@@ -59,3 +60,4 @@ if __name__ == "__main__":
......@@ -44,7 +44,9 @@
<agents operational_model_id="1">
<agents_distribution>
<!-- <30 -->
<group group_id="0" agent_parameter_id="1" subroom_id="0" goal_id="-1" number="150" router_id="1" pre_movement_mean="0" pre_movement_sigma="0" x_min="60" x_max="80"/>
<group group_id="0" agent_parameter_id="1" subroom_id="0" goal_id="-1" number="1
50" router_id="1" pre_movement_mean="0" pre_movement_sigma="0" x_min="60" x_max="80"/>
<!-- 30-50 -->
<group group_id="1" agent_parameter_id="2" subroom_id="0" goal_id="-1" number="150" router_id="1" pre_movement_mean="30" pre_movement_sigma="0" x_min="40" x_max="60"/>
<!-- >50 -->
......
......@@ -37,9 +37,9 @@ CHECK
CLOSED: [2015-06-30 Tue 14:54]
- State "DONE" from "TODO" [2015-06-30 Tue 14:54]
** TODO test_11
PASS
- @Ulrich: only 3 peds (from 1000) choose the second exit
** DONE test_11
CLOSED: [2015-07-06 Mon 13:32]
- State "DONE" from "TODO" [2015-07-06 Mon 13:32]
** DONE test_12
CLOSED: [2015-06-29 Mon 15:27]
......@@ -47,7 +47,9 @@ CLOSED: [2015-06-29 Mon 15:27]
- Maybe we have to slightly modify the geometry like PTV did. We do
not have a "buffer" room at the end
** TODO test_13
** DONE test_13
CLOSED: [2015-07-06 Mon 08:52]
- State "DONE" from "TODO" [2015-07-06 Mon 08:52]
- @Mohcine: We have to make the transition to/from stair smoother
** TODO test_14
......
......@@ -372,15 +372,21 @@ const Point& Pedestrian::GetV0() const
double Pedestrian::GetV0Norm() const
{
// @todo: we need to know the difference of the ped_elevation to the old_nav_elevation, and use this in the function f.
//detect the walking direction based on the elevation
SubRoom* sub=_building->GetRoom(_roomID)->GetSubRoom(_subRoomID);
double ped_elevation = sub->GetElevation(_ellipse.GetCenter());
double nav_elevation = sub->GetElevation(_navLine->GetCentre());
const Point& target = _navLine->GetCentre();
double nav_elevation = sub->GetElevation(target);
double delta = nav_elevation - ped_elevation;
// const Point& pos = GetPos();
// double distanceToTarget = (target-pos).Norm();
// double iniDistanceToTarget = (target-_lastPositions.front()).Norm();
// 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);
//printf("delta = %f, nav_elev = %f, ped_elev= %f\n", delta, nav_elevation, ped_elevation);
// fprintf(stderr, "%f %f front [%f, %f] nav [%f, %f] dist=%f, iniDist=%f\n", delta, ped_elevation, _lastPositions.front()._x, _lastPositions.front()._y, _navLine->GetCentre()._x, _navLine->GetCentre()._y, distanceToTarget, iniDistanceToTarget);
// we are walking on an even plane
//TODO: move _ellipse.GetV0() to _V0Plane
......
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