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
e293932f
Verified
Commit
e293932f
authored
Feb 26, 2019
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove warnings
parent
4cee65ef
Pipeline
#17476
passed with stages
in 32 seconds
Changes
14
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
2610 additions
and
2581 deletions
+2610
-2581
IO/OutputHandler.cpp
IO/OutputHandler.cpp
+29
-0
IO/OutputHandler.h
IO/OutputHandler.h
+1
-0
general/Macros.h
general/Macros.h
+2
-2
geometry/SubRoom.cpp
geometry/SubRoom.cpp
+7
-7
methods/Method_A.cpp
methods/Method_A.cpp
+2
-2
methods/Method_B.cpp
methods/Method_B.cpp
+2
-2
methods/Method_D.cpp
methods/Method_D.cpp
+5
-5
methods/Method_D.h
methods/Method_D.h
+1
-2
methods/Method_I.cpp
methods/Method_I.cpp
+5
-5
methods/Method_I.h
methods/Method_I.h
+1
-2
methods/PedData.cpp
methods/PedData.cpp
+6
-6
methods/VoronoiDiagram.cpp
methods/VoronoiDiagram.cpp
+4
-4
tinyxml/tinyxml.cpp
tinyxml/tinyxml.cpp
+1142
-1143
tinyxml/tinyxmlparser.cpp
tinyxml/tinyxmlparser.cpp
+1403
-1401
No files found.
IO/OutputHandler.cpp
View file @
e293932f
...
...
@@ -116,6 +116,35 @@ void OutputHandler::Write(const char* message,...)
}
}
void
STDIOHandler
::
Write
(
const
char
*
message
,...)
{
char
msg
[
CLENGTH
]
=
""
;
va_list
ap
;
va_start
(
ap
,
message
);
vsprintf
(
msg
,
message
,
ap
);
va_end
(
ap
);
string
str
(
msg
);
if
(
str
.
find
(
"ERROR"
)
!=
string
::
npos
)
{
cerr
<<
msg
<<
endl
;
cerr
.
flush
();
incrementErrors
();
}
else
if
(
str
.
find
(
"WARNING"
)
!=
string
::
npos
)
{
cerr
<<
msg
<<
endl
;
cerr
.
flush
();
incrementWarnings
();
}
else
{
// infos
cout
<<
msg
<<
endl
;
cout
.
flush
();
}
}
void
STDIOHandler
::
Write
(
const
string
&
str
)
{
if
(
str
.
find
(
"ERROR"
)
!=
string
::
npos
)
...
...
IO/OutputHandler.h
View file @
e293932f
...
...
@@ -61,6 +61,7 @@ public:
class
STDIOHandler
:
public
OutputHandler
{
public:
void
Write
(
const
std
::
string
&
str
);
void
Write
(
const
char
*
string
,...);
};
class
FileHandler
:
public
OutputHandler
{
...
...
general/Macros.h
View file @
e293932f
...
...
@@ -217,9 +217,9 @@ inline std::string polygon_to_string(const polygon_2d & polygon)
polygon_str
.
append
(
std
::
to_string
(
y
));
polygon_str
.
append
(
"), "
);
}
for
(
auto
r
ing
:
boost
::
geometry
::
interior_rings
(
polygon
)
)
for
(
auto
pR
ing
:
boost
::
geometry
::
interior_rings
(
polygon
)
)
{
for
(
auto
point
:
r
ing
)
for
(
auto
point
:
pR
ing
)
{
double
x
=
boost
::
geometry
::
get
<
0
>
(
point
);
double
y
=
boost
::
geometry
::
get
<
1
>
(
point
);
...
...
geometry/SubRoom.cpp
View file @
e293932f
...
...
@@ -379,8 +379,8 @@ bool SubRoom::IsVisible(const Line &wall, const Point &position)
return
wall_is_vis
;
}
// p1 and p2 are supposed to be pedestrian's positions. This function does not work properly
// for visibility checks with walls, since the line connecting the pedestrian's position
// p1 and p2 are supposed to be pedestrian's positions. This function does not work properly
// for visibility checks with walls, since the line connecting the pedestrian's position
// with the nearest point on the wall IS intersecting with the wall.
bool
SubRoom
::
IsVisible
(
const
Point
&
p1
,
const
Point
&
p2
,
bool
considerHlines
)
{
...
...
@@ -744,13 +744,13 @@ string NormalSubRoom::WriteSubRoom() const
s
.
append
(
"
\t\t
</wall>
\n
"
);
}
const
Point
&
pos
=
obst
->
GetCentroid
();
const
Point
&
pos
Center
=
obst
->
GetCentroid
();
//add the obstacle caption
char
t
mp
[
CLENGTH
];
sprintf
(
t
mp
,
"
\t\t
<label centerX=
\"
%.2f
\"
centerY=
\"
%.2f
\"
centerZ=
\"
%.2f
\"
text=
\"
%d
\"
color=
\"
100
\"
/>
\n
"
,
pos
.
GetX
()
*
FAKTOR
,
pos
.
GetY
()
*
FAKTOR
,
GetElevation
(
pos
)
*
FAKTOR
,
obst
->
GetId
());
s
.
append
(
t
mp
);
char
T
mp
[
CLENGTH
];
sprintf
(
T
mp
,
"
\t\t
<label centerX=
\"
%.2f
\"
centerY=
\"
%.2f
\"
centerZ=
\"
%.2f
\"
text=
\"
%d
\"
color=
\"
100
\"
/>
\n
"
,
pos
Center
.
GetX
()
*
FAKTOR
,
posCenter
.
GetY
()
*
FAKTOR
,
GetElevation
(
posCenter
)
*
FAKTOR
,
obst
->
GetId
());
s
.
append
(
T
mp
);
}
return
s
;
...
...
methods/Method_A.cpp
View file @
e293932f
...
...
@@ -38,8 +38,8 @@ Method_A::Method_A()
{
_classicFlow
=
0
;
_vDeltaT
=
0
;
ub
::
matrix
<
double
>
_xCor
(
0
,
0
);
ub
::
matrix
<
double
>
_yCor
(
0
,
0
);
_xCor
(
0
,
0
);
_yCor
(
0
,
0
);
_firstFrame
=
nullptr
;
_passLine
=
nullptr
;
_deltaT
=
100
;
...
...
methods/Method_B.cpp
View file @
e293932f
...
...
@@ -34,8 +34,8 @@ using std::vector;
Method_B
::
Method_B
()
{
ub
::
matrix
<
double
>
_xCor
(
0
,
0
);
ub
::
matrix
<
double
>
_yCor
(
0
,
0
);
_xCor
(
0
,
0
);
_yCor
(
0
,
0
);
_tIn
=
nullptr
;
_tOut
=
nullptr
;
_entrancePoint
=
{};
...
...
methods/Method_D.cpp
View file @
e293932f
...
...
@@ -198,7 +198,7 @@ bool Method_D::Process (const PedData& peddata,const fs::path& scriptsLocation,
}
if
(
_outputVoronoiCellData
)
{
// output the Voronoi polygons of a frame
OutputVoroGraph
(
str_frid
,
polygons_id
,
NumPeds
,
XInFrame
,
YInFrame
,
VInFrame
);
OutputVoroGraph
(
str_frid
,
polygons_id
,
NumPeds
,
VInFrame
);
}
}
else
...
...
@@ -404,7 +404,7 @@ void Method_D::GetProfiles(const string& frameId, const vector<polygon_2d>& poly
fclose
(
Prf_density
);
}
void
Method_D
::
OutputVoroGraph
(
const
string
&
frameId
,
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>&
polygons_id
,
int
numPedsInFrame
,
vector
<
double
>&
XInFrame
,
vector
<
double
>&
YInFrame
,
const
vector
<
double
>&
VInFrame
)
void
Method_D
::
OutputVoroGraph
(
const
string
&
frameId
,
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>&
polygons_id
,
int
numPedsInFrame
,
const
vector
<
double
>&
VInFrame
)
{
//string voronoiLocation=_projectRootDir+"./Output/Fundamental_Diagram/Classical_Voronoi/VoronoiCell/id_"+_measureAreaId;
...
...
@@ -444,9 +444,9 @@ void Method_D::OutputVoroGraph(const string & frameId, std::vector<std::pair<po
if
(
polys
.
is_open
())
{
//for(vector<polygon_2d> polygon_iterator=polygons.begin(); polygon_iterator!=polygons.end(); polygon_iterator++)
for
(
auto
&&
p
:
polygons_id
)
for
(
auto
&&
p
_it
:
polygons_id
)
{
poly
=
p
.
first
;
poly
=
p
_it
.
first
;
for
(
auto
&&
point
:
poly
.
outer
())
{
point
.
x
(
point
.
x
()
*
CMtoM
);
...
...
@@ -460,7 +460,7 @@ void Method_D::OutputVoroGraph(const string & frameId, std::vector<std::pair<po
point
.
y
(
point
.
y
()
*
CMtoM
);
}
}
polys
<<
p
.
second
<<
" | "
<<
dsv
(
poly
)
<<
endl
;
polys
<<
p
_it
.
second
<<
" | "
<<
dsv
(
poly
)
<<
endl
;
//polys <<dsv(poly)<< endl;
}
}
...
...
methods/Method_D.h
View file @
e293932f
...
...
@@ -102,8 +102,7 @@ private:
void
OutputVoronoiResults
(
const
std
::
vector
<
polygon_2d
>&
polygons
,
const
std
::
string
&
frid
,
const
std
::
vector
<
double
>&
VInFrame
);
std
::
tuple
<
double
,
double
>
GetVoronoiDensityVelocity
(
const
std
::
vector
<
polygon_2d
>&
polygon
,
const
std
::
vector
<
double
>&
Velocity
,
const
polygon_2d
&
measureArea
);
void
GetProfiles
(
const
std
::
string
&
frameId
,
const
std
::
vector
<
polygon_2d
>&
polygons
,
const
std
::
vector
<
double
>&
velocity
);
void
OutputVoroGraph
(
const
std
::
string
&
frameId
,
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>&
polygons
,
int
numPedsInFrame
,
std
::
vector
<
double
>&
XInFrame
,
std
::
vector
<
double
>&
YInFrame
,
const
std
::
vector
<
double
>&
VInFrame
);
void
OutputVoroGraph
(
const
std
::
string
&
frameId
,
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>&
polygons
,
int
numPedsInFrame
,
const
std
::
vector
<
double
>&
VInFrame
);
void
GetIndividualFD
(
const
std
::
vector
<
polygon_2d
>&
polygon
,
const
std
::
vector
<
double
>&
Velocity
,
const
std
::
vector
<
int
>&
Id
,
const
polygon_2d
&
measureArea
,
const
std
::
string
&
frid
);
/**
* Reduce the precision of the points to two digits
...
...
methods/Method_I.cpp
View file @
e293932f
...
...
@@ -197,7 +197,7 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
}
if
(
_outputVoronoiCellData
)
{
// output the Voronoi polygons of a frame
OutputVoroGraph
(
str_frid
,
polygons_id
,
NumPeds
,
XInFrame
,
YInFrame
,
VInFrame
);
OutputVoroGraph
(
str_frid
,
polygons_id
,
NumPeds
,
VInFrame
);
}
}
else
...
...
@@ -396,7 +396,7 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
fclose
(
Prf_density
);
}
void
Method_I
::
OutputVoroGraph
(
const
string
&
frameId
,
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>&
polygons_id
,
int
numPedsInFrame
,
vector
<
double
>&
XInFrame
,
vector
<
double
>&
YInFrame
,
const
vector
<
double
>&
VInFrame
)
void
Method_I
::
OutputVoroGraph
(
const
string
&
frameId
,
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>&
polygons_id
,
int
numPedsInFrame
,
const
vector
<
double
>&
VInFrame
)
{
//string voronoiLocation=_projectRootDir+"./Output/Fundamental_Diagram/Classical_Voronoi/VoronoiCell/id_"+_measureAreaId;
...
...
@@ -436,9 +436,9 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
if
(
polys
.
is_open
())
{
//for(vector<polygon_2d> polygon_iterator=polygons.begin(); polygon_iterator!=polygons.end(); polygon_iterator++)
for
(
auto
&&
p
:
polygons_id
)
for
(
auto
&&
p
olygon_id
:
polygons_id
)
{
poly
=
p
.
first
;
poly
=
p
olygon_id
.
first
;
for
(
auto
&&
point
:
poly
.
outer
())
{
point
.
x
(
point
.
x
()
*
CMtoM
);
...
...
@@ -452,7 +452,7 @@ bool Method_I::Process(const PedData& peddata,const fs::path& scriptsLocation, c
point
.
y
(
point
.
y
()
*
CMtoM
);
}
}
polys
<<
p
.
second
<<
" | "
<<
dsv
(
poly
)
<<
endl
;
polys
<<
p
olygon_id
.
second
<<
" | "
<<
dsv
(
poly
)
<<
endl
;
//polys <<dsv(poly)<< endl;
}
}
...
...
methods/Method_I.h
View file @
e293932f
...
...
@@ -102,8 +102,7 @@ private:
void
OutputVoronoiResults
(
const
std
::
vector
<
polygon_2d
>&
polygons
,
const
std
::
string
&
frid
,
const
std
::
vector
<
double
>&
VInFrame
);
std
::
tuple
<
double
,
double
>
GetVoronoiDensityVelocity
(
const
std
::
vector
<
polygon_2d
>&
polygon
,
const
std
::
vector
<
double
>&
Velocity
,
const
polygon_2d
&
measureArea
);
void
GetProfiles
(
const
std
::
string
&
frameId
,
const
std
::
vector
<
polygon_2d
>&
polygons
,
const
std
::
vector
<
double
>&
velocity
);
void
OutputVoroGraph
(
const
std
::
string
&
frameId
,
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>&
polygons
,
int
numPedsInFrame
,
std
::
vector
<
double
>&
XInFrame
,
std
::
vector
<
double
>&
YInFrame
,
const
std
::
vector
<
double
>&
VInFrame
);
void
OutputVoroGraph
(
const
std
::
string
&
frameId
,
std
::
vector
<
std
::
pair
<
polygon_2d
,
int
>
>&
polygons
,
int
numPedsInFrame
,
const
std
::
vector
<
double
>&
VInFrame
);
void
GetIndividualFD
(
const
std
::
vector
<
polygon_2d
>&
polygon
,
const
std
::
vector
<
double
>&
Velocity
,
const
std
::
vector
<
int
>&
Id
,
const
polygon_2d
&
measureArea
,
const
std
::
string
&
frid
);
/**
* Reduce the precision of the points to two digits
...
...
methods/PedData.cpp
View file @
e293932f
...
...
@@ -284,15 +284,15 @@ bool PedData::InitializeVariables(const fs::path& filename)
// are consecutive. 1, 2, 10,
// 11 does not work
//---------- get position of index in unique index vector ---------------
auto
it
=
std
::
find
(
unique_ids
.
begin
(),
unique_ids
.
end
(),
_IdsTXT
[
i
]);
if
(
it
==
unique_ids
.
end
())
auto
it
_uid
=
std
::
find
(
unique_ids
.
begin
(),
unique_ids
.
end
(),
_IdsTXT
[
i
]);
if
(
it
_uid
==
unique_ids
.
end
())
{
Log
->
Write
(
"Error:
\t
Id %d does not exist in file"
,
_IdsTXT
[
i
]);
return
false
;
}
else
{
ID
=
std
::
distance
(
unique_ids
.
begin
(),
it
);
ID
=
std
::
distance
(
unique_ids
.
begin
(),
it
_uid
);
}
//--------------------
int
frm
=
_FramesTXT
[
i
]
-
_minFrame
;
...
...
@@ -321,15 +321,15 @@ bool PedData::InitializeVariables(const fs::path& filename)
// indexes in the trajectories
// are consecutive
auto
it
=
std
::
find
(
unique_ids
.
begin
(),
unique_ids
.
end
(),
_IdsTXT
[
i
]);
if
(
it
==
unique_ids
.
end
())
auto
it
Ids
=
std
::
find
(
unique_ids
.
begin
(),
unique_ids
.
end
(),
_IdsTXT
[
i
]);
if
(
it
Ids
==
unique_ids
.
end
())
{
Log
->
Write
(
"Error2:
\t
Id %d does not exist in file"
,
_IdsTXT
[
i
]);
return
false
;
}
else
{
id
=
std
::
distance
(
unique_ids
.
begin
(),
it
);
id
=
std
::
distance
(
unique_ids
.
begin
(),
it
Ids
);
}
int
t
=
_FramesTXT
[
i
]
-
_minFrame
;
...
...
methods/VoronoiDiagram.cpp
View file @
e293932f
...
...
@@ -447,10 +447,10 @@ point_type2 VoronoiDiagram::getIntersectionPoint(const point_2d& pt0, const poin
{
vector
<
point_2d
>
pt
;
segment
edge0
(
pt0
,
pt1
);
vector
<
point_2d
>
const
&
points
=
square
.
outer
();
for
(
vector
<
point_2d
>::
size_type
i
=
1
;
i
<
points
.
size
();
++
i
)
vector
<
point_2d
>
const
&
o
points
=
square
.
outer
();
for
(
vector
<
point_2d
>::
size_type
i
=
1
;
i
<
o
points
.
size
();
++
i
)
{
segment
edge1
(
points
[
i
],
points
[
i
-
1
]);
segment
edge1
(
opoints
[
i
],
o
points
[
i
-
1
]);
if
(
intersects
(
edge0
,
edge1
))
{
intersection
(
edge0
,
edge1
,
pt
);
...
...
@@ -459,7 +459,7 @@ point_type2 VoronoiDiagram::getIntersectionPoint(const point_2d& pt0, const poin
}
if
(
pt
.
empty
())
{
segment
edge1
(
points
[
3
],
points
[
0
]);
segment
edge1
(
opoints
[
3
],
o
points
[
0
]);
intersection
(
edge0
,
edge1
,
pt
);
}
point_type2
interpts
(
pt
[
0
].
x
(),
pt
[
0
].
y
());
...
...
tinyxml/tinyxml.cpp
View file @
e293932f
This diff is collapsed.
Click to expand it.
tinyxml/tinyxmlparser.cpp
View file @
e293932f
This diff is collapsed.
Click to expand it.
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