Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
JPScore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
92
Issues
92
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JuPedSim
JPScore
Commits
16bce738
Commit
16bce738
authored
Jul 06, 2015
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test 11 use jpscore statistics
parent
b0ec8fab
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
106 additions
and
70 deletions
+106
-70
Utest/rimea_tests/test_10/geometry.xml
Utest/rimea_tests/test_10/geometry.xml
+2
-2
Utest/rimea_tests/test_10/runtest_rimea_10.py
Utest/rimea_tests/test_10/runtest_rimea_10.py
+1
-0
Utest/rimea_tests/test_11/geometry.xml
Utest/rimea_tests/test_11/geometry.xml
+53
-36
Utest/rimea_tests/test_11/master_ini.xml
Utest/rimea_tests/test_11/master_ini.xml
+7
-5
Utest/rimea_tests/test_11/runtest_rimea_11.py
Utest/rimea_tests/test_11/runtest_rimea_11.py
+23
-19
Utest/rimea_tests/test_12/runtest_rimea_12.py
Utest/rimea_tests/test_12/runtest_rimea_12.py
+2
-0
Utest/rimea_tests/test_7/master_ini.xml
Utest/rimea_tests/test_7/master_ini.xml
+3
-1
Utest/rimea_tests/todo.org
Utest/rimea_tests/todo.org
+6
-4
pedestrian/Pedestrian.cpp
pedestrian/Pedestrian.cpp
+9
-3
No files found.
Utest/rimea_tests/test_10/geometry.xml
View file @
16bce738
...
...
@@ -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"
/>
...
...
Utest/rimea_tests/test_10/runtest_rimea_10.py
View file @
16bce738
...
...
@@ -75,3 +75,4 @@ if __name__ == "__main__":
Utest/rimea_tests/test_11/geometry.xml
View file @
16bce738
<?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>
Utest/rimea_tests/test_11/master_ini.xml
View file @
16bce738
...
...
@@ -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=
"2
7.0"
py=
"20
.5"
/>
<vertex
px=
"2
7.5"
py=
"20
.5"
/>
<vertex
px=
"2
7.5"
py=
"21
.0"
/>
<vertex
px=
"2
7.0"
py=
"21
.0"
/>
<vertex
px=
"2
7.0"
py=
"20
.5"
/>
<vertex
px=
"2
5.0"
py=
"24
.5"
/>
<vertex
px=
"2
5.5"
py=
"24
.5"
/>
<vertex
px=
"2
5.5"
py=
"25
.0"
/>
<vertex
px=
"2
5.0"
py=
"25
.0"
/>
<vertex
px=
"2
5.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>
...
...
Utest/rimea_tests/test_11/runtest_rimea_11.py
View file @
16bce738
...
...
@@ -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__":
Utest/rimea_tests/test_12/runtest_rimea_12.py
View file @
16bce738
...
...
@@ -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__":
Utest/rimea_tests/test_7/master_ini.xml
View file @
16bce738
...
...
@@ -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 -->
...
...
Utest/rimea_tests/todo.org
View file @
16bce738
...
...
@@ -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
...
...
pedestrian/Pedestrian.cpp
View file @
16bce738
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment