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
JPSreport
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
JuPedSim
JPSreport
Commits
b7f73ad6
Verified
Commit
b7f73ad6
authored
Feb 25, 2019
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dummy pedestrians when numPeds < 3
parent
f6bb29e8
Pipeline
#17432
failed with stages
in 39 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
558 additions
and
541 deletions
+558
-541
Analysis.cpp
Analysis.cpp
+5
-8
methods/Method_I.cpp
methods/Method_I.cpp
+523
-532
methods/VoronoiDiagram.cpp
methods/VoronoiDiagram.cpp
+30
-1
No files found.
Analysis.cpp
View file @
b7f73ad6
...
...
@@ -161,6 +161,7 @@ void Analysis::InitArgs(ArgumentParser* args)
_StopFramesMethodD
=
args
->
GetStopFramesMethodD
();
_IndividualFDFlags
=
args
->
GetIndividualFDFlags
();
_plotTimeseriesD
=
args
->
GetIsPlotTimeSeriesD
();
_geoPoly
=
ReadGeometry
(
args
->
GetGeometryFilename
(),
_areaForMethod_D
);
}
if
(
args
->
GetIsMethodI
())
{
_DoesUseMethodI
=
true
;
...
...
@@ -173,6 +174,7 @@ void Analysis::InitArgs(ArgumentParser* args)
_StopFramesMethodI
=
args
->
GetStopFramesMethodI
();
_IndividualFDFlags
=
args
->
GetIndividualFDFlags
();
_plotTimeseriesI
=
args
->
GetIsPlotTimeSeriesI
();
_geoPoly
=
ReadGeometry
(
args
->
GetGeometryFilename
(),
_areaForMethod_I
);
}
_deltaF
=
args
->
GetDelatT_Vins
();
...
...
@@ -186,7 +188,6 @@ void Analysis::InitArgs(ArgumentParser* args)
_IgnoreBackwardMovement
=
args
->
GetIgnoreBackwardMovement
();
_grid_size_X
=
int
(
args
->
GetGridSizeX
());
_grid_size_Y
=
int
(
args
->
GetGridSizeY
());
_geoPoly
=
ReadGeometry
(
args
->
GetGeometryFilename
(),
_areaForMethod_D
);
_geometryFileName
=
args
->
GetGeometryFilename
();
_projectRootDir
=
args
->
GetProjectRootDir
();
_trajFormat
=
args
->
GetFileFormat
();
...
...
@@ -199,11 +200,11 @@ void Analysis::InitArgs(ArgumentParser* args)
std
::
map
<
int
,
polygon_2d
>
Analysis
::
ReadGeometry
(
const
fs
::
path
&
geometryFile
,
const
std
::
vector
<
MeasurementArea_B
*>&
areas
)
{
_building
=
new
Building
();
_building
->
LoadGeometry
(
geometryFile
.
string
());
// create the polygons
_building
->
InitGeometry
();
// _building->AddSurroundingRoom();
double
geo_minX
=
FLT_MAX
;
double
geo_minY
=
FLT_MAX
;
...
...
@@ -221,10 +222,8 @@ std::map<int, polygon_2d> Analysis::ReadGeometry(const fs::path& geometryFile, c
for
(
auto
&&
it_sub
:
it_room
.
second
->
GetAllSubRooms
())
{
SubRoom
*
subroom
=
it_sub
.
second
.
get
();
point_2d
point
(
0
,
0
);
boost
::
geometry
::
centroid
(
area
->
_poly
,
point
);
//check if the area is contained in the obstacle
if
(
subroom
->
IsInSubRoom
(
Point
(
point
.
x
()
/
M2CM
,
point
.
y
()
/
M2CM
)))
{
...
...
@@ -245,7 +244,6 @@ std::map<int, polygon_2d> Analysis::ReadGeometry(const fs::path& geometryFile, c
geoPoly
[
area
->
_id
].
inners
().
resize
(
k
++
);
geoPoly
[
area
->
_id
].
inners
().
back
();
model
::
ring
<
point_2d
>&
inner
=
geoPoly
[
area
->
_id
].
inners
().
back
();
for
(
auto
&&
tmp_point
:
obst
->
GetPolygon
())
{
append
(
inner
,
make
<
point_2d
>
(
tmp_point
.
_x
*
M2CM
,
tmp_point
.
_y
*
M2CM
));
...
...
@@ -267,9 +265,8 @@ std::map<int, polygon_2d> Analysis::ReadGeometry(const fs::path& geometryFile, c
_highVertexY
=
geo_maxY
;
_lowVertexX
=
geo_minX
;
_lowVertexY
=
geo_minY
;
//
using boost::geometry::dsv;
using
boost
::
geometry
::
dsv
;
// cout<<"INFO: \tGeometry polygon is:\t" << dsv(geoPoly[1])<<endl;
return
geoPoly
;
}
...
...
@@ -488,7 +485,7 @@ int Analysis::RunAnalysis(const fs::path& filename, const fs::path& path)
bool
result_I
=
method_I
.
Process
(
data
,
_scriptsLocation
,
_areaForMethod_I
[
i
]
->
_zPos
);
if
(
result_I
)
{
Log
->
Write
(
"INFO:
\t
Success with Method I uing measurement area id %d!
\n
"
,
_areaForMethod_I
[
i
]
->
_id
);
Log
->
Write
(
"INFO:
\t
Success with Method I u
s
ing measurement area id %d!
\n
"
,
_areaForMethod_I
[
i
]
->
_id
);
std
::
cout
<<
"INFO:
\t
Success with Method I using measurement area id "
<<
_areaForMethod_I
[
i
]
->
_id
<<
"
\n
"
;
if
(
_plotTimeseriesI
[
i
])
{
...
...
methods/Method_I.cpp
View file @
b7f73ad6
This diff is collapsed.
Click to expand it.
methods/VoronoiDiagram.cpp
View file @
b7f73ad6
...
...
@@ -49,11 +49,39 @@ VoronoiDiagram::~VoronoiDiagram()
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>
VoronoiDiagram
::
getVoronoiPolygons
(
vector
<
double
>&
XInFrame
,
vector
<
double
>&
YInFrame
,
vector
<
double
>&
VInFrame
,
vector
<
int
>&
IdInFrame
,
const
double
Bound_Max
)
{
const
int
numPedsInFrame
=
IdInFrame
.
size
();
int
numPedsInFrame
=
IdInFrame
.
size
();
vector
<
int
>
XInFrame_temp
;
vector
<
int
>
YInFrame_temp
;
vector
<
double
>
VInFrame_temp
;
vector
<
int
>
IdInFrame_temp
;
// in case 1 or 2 pedestrians are in the geometry
// add dummy pedestrians around to enable voronoi calculations
// @todo: maybe use negative ids for these dummy pedestrians to exclude
// them from any analysis.
if
(
numPedsInFrame
==
1
||
numPedsInFrame
==
2
)
{
numPedsInFrame
+=
4
;
// up right
XInFrame
.
push_back
(
XInFrame
[
0
]
+
10
);
YInFrame
.
push_back
(
YInFrame
[
0
]
+
10
);
VInFrame
.
push_back
(
VInFrame
[
0
]);
IdInFrame
.
push_back
(
IdInFrame
[
0
]
+
1
);
// up left
XInFrame
.
push_back
(
XInFrame
[
0
]
-
10
);
YInFrame
.
push_back
(
YInFrame
[
0
]
+
10
);
VInFrame
.
push_back
(
VInFrame
[
0
]);
IdInFrame
.
push_back
(
IdInFrame
[
0
]
+
2
);
// down right
XInFrame
.
push_back
(
XInFrame
[
0
]
+
10
);
YInFrame
.
push_back
(
YInFrame
[
0
]
-
10
);
VInFrame
.
push_back
(
VInFrame
[
0
]);
IdInFrame
.
push_back
(
IdInFrame
[
0
]
+
3
);
// down left
XInFrame
.
push_back
(
XInFrame
[
0
]
-
10
);
YInFrame
.
push_back
(
YInFrame
[
0
]
-
10
);
VInFrame
.
push_back
(
VInFrame
[
0
]);
IdInFrame
.
push_back
(
IdInFrame
[
0
]
+
4
);
}
for
(
int
i
=
0
;
i
<
numPedsInFrame
;
i
++
)
{
...
...
@@ -64,6 +92,7 @@ std::vector<std::pair<polygon_2d, int> > VoronoiDiagram::getVoronoiPolygons(vect
IdInFrame_temp
.
push_back
(
IdInFrame
[
i
]);
}
VD
voronoidiagram
;
construct_voronoi
(
points
.
begin
(),
points
.
end
(),
&
voronoidiagram
);
int
Ncell
=
0
;
...
...
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