Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
JPSreport
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JuPedSim
JPSreport
Commits
d1239d2d
Verified
Commit
d1239d2d
authored
6 years ago
by
Mohcine Chraibi
Browse files
Options
Downloads
Plain Diff
Merge branch '98-PersID' of
http://gitlab.version.fz-juelich.de/jupedsim/jpsreport
into 98-PersID
parents
45d7003e
66265499
Branches
Branches containing commit
No related tags found
1 merge request
!15
Resolve "Method D | IndividualFD file use wrong PersID"
Pipeline
#17812
failed
6 years ago
Stage: configure
Stage: compile
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
methods/Method_D.cpp
+1
-1
1 addition, 1 deletion
methods/Method_D.cpp
methods/PedData.cpp
+15
-5
15 additions, 5 deletions
methods/PedData.cpp
methods/PedData.h
+1
-0
1 addition, 0 deletions
methods/PedData.h
with
17 additions
and
6 deletions
methods/Method_D.cpp
+
1
−
1
View file @
d1239d2d
...
@@ -138,7 +138,7 @@ bool Method_D::Process (const PedData& peddata,const fs::path& scriptsLocation,
...
@@ -138,7 +138,7 @@ bool Method_D::Process (const PedData& peddata,const fs::path& scriptsLocation,
}
}
vector
<
int
>
ids
=
_peds_t
[
frameNr
];
vector
<
int
>
ids
=
_peds_t
[
frameNr
];
vector
<
int
>
IdInFrame
=
peddata
.
GetIdInFrame
(
frameNr
,
ids
,
zPos_measureArea
);
vector
<
int
>
IdInFrame
=
peddata
.
GetIdInFrame
(
frameNr
,
ids
,
zPos_measureArea
);
vector
<
double
>
X
InFrame
=
peddata
.
Get
X
InFrame
(
frameNr
,
ids
,
zPos_measureArea
);
//
vector<
int> RealId
InFrame = peddata.Get
RealId
InFrame(frameNr, ids, zPos_measureArea);
vector
<
double
>
YInFrame
=
peddata
.
GetYInFrame
(
frameNr
,
ids
,
zPos_measureArea
);
vector
<
double
>
YInFrame
=
peddata
.
GetYInFrame
(
frameNr
,
ids
,
zPos_measureArea
);
vector
<
double
>
VInFrame
=
peddata
.
GetVInFrame
(
frameNr
,
ids
,
zPos_measureArea
);
vector
<
double
>
VInFrame
=
peddata
.
GetVInFrame
(
frameNr
,
ids
,
zPos_measureArea
);
//vector int to_remove
//vector int to_remove
...
...
This diff is collapsed.
Click to expand it.
methods/PedData.cpp
+
15
−
5
View file @
d1239d2d
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#include
"PedData.h"
#include
"PedData.h"
#include
<cmath>
#include
<cmath>
#include
<string>
#include
<string>
#include
<set>
using
std
::
string
;
using
std
::
string
;
using
std
::
map
;
using
std
::
map
;
using
std
::
vector
;
using
std
::
vector
;
...
@@ -45,6 +47,7 @@ PedData::~PedData()
...
@@ -45,6 +47,7 @@ PedData::~PedData()
bool
PedData
::
ReadData
(
const
fs
::
path
&
projectRootDir
,
const
fs
::
path
&
outputLocation
,
const
fs
::
path
&
path
,
const
fs
::
path
&
filename
,
const
FileFormat
&
trajformat
,
int
deltaF
,
std
::
string
vComponent
,
const
bool
IgnoreBackwardMovement
)
bool
PedData
::
ReadData
(
const
fs
::
path
&
projectRootDir
,
const
fs
::
path
&
outputLocation
,
const
fs
::
path
&
path
,
const
fs
::
path
&
filename
,
const
FileFormat
&
trajformat
,
int
deltaF
,
std
::
string
vComponent
,
const
bool
IgnoreBackwardMovement
)
{
{
_minID
=
INT_MAX
;
_minID
=
INT_MAX
;
_maxID
=
INT_MAX
;
_minFrame
=
INT_MAX
;
_minFrame
=
INT_MAX
;
_deltaF
=
deltaF
;
_deltaF
=
deltaF
;
_vComponent
=
vComponent
;
_vComponent
=
vComponent
;
...
@@ -218,10 +221,13 @@ bool PedData::InitializeVariables(const fs::path& filename)
...
@@ -218,10 +221,13 @@ bool PedData::InitializeVariables(const fs::path& filename)
Log
->
Write
(
"INFO:
\t
Finished reading the data"
);
Log
->
Write
(
"INFO:
\t
Finished reading the data"
);
}
}
fdata
.
close
();
fdata
.
close
();
Log
->
Write
(
"INFO: Got %d lines"
,
_IdsTXT
.
size
());
Log
->
Write
(
"INFO: Got %d lines"
,
_IdsTXT
.
size
());
_minID
=
*
min_element
(
_IdsTXT
.
begin
(),
_IdsTXT
.
end
());
_minID
=
*
min_element
(
_IdsTXT
.
begin
(),
_IdsTXT
.
end
());
_maxID
=
*
max_element
(
_IdsTXT
.
begin
(),
_IdsTXT
.
end
());
Log
->
Write
(
"INFO: minID: %d"
,
_minID
);
Log
->
Write
(
"INFO: minID: %d"
,
_minID
);
Log
->
Write
(
"INFO: maxID: %d"
,
_maxID
);
_minFrame
=
*
min_element
(
_FramesTXT
.
begin
(),
_FramesTXT
.
end
());
_minFrame
=
*
min_element
(
_FramesTXT
.
begin
(),
_FramesTXT
.
end
());
Log
->
Write
(
"INFO: minFrame: %d"
,
_minFrame
);
Log
->
Write
(
"INFO: minFrame: %d"
,
_minFrame
);
//Total number of frames
//Total number of frames
...
@@ -230,12 +236,16 @@ bool PedData::InitializeVariables(const fs::path& filename)
...
@@ -230,12 +236,16 @@ bool PedData::InitializeVariables(const fs::path& filename)
//Total number of agents
//Total number of agents
std
::
vector
<
int
>
unique_ids
=
_IdsTXT
;
std
::
vector
<
int
>
unique_ids
=
_IdsTXT
;
// no need to
// no need to
//sort. Assume that ids are ascendant
//sort. Assume that ids are ascendant
sort
(
unique_ids
.
begin
(),
unique_ids
.
end
());
std
::
vector
<
int
>::
iterator
it
;
std
::
set
<
int
>
s
;
it
=
unique
(
unique_ids
.
begin
(),
unique_ids
.
end
());
for
(
auto
a
:
_IdsTXT
)
unique_ids
.
resize
(
distance
(
unique_ids
.
begin
(),
it
));
{
s
.
insert
(
a
);
}
unique_ids
.
assign
(
s
.
begin
(),
s
.
end
()
);
_numPeds
=
unique_ids
.
size
();
_numPeds
=
unique_ids
.
size
();
Log
->
Write
(
"INFO: Total number of Agents: %d"
,
_numPeds
);
Log
->
Write
(
"INFO: Total number of Agents: %d"
,
_numPeds
);
CreateGlobalVariables
(
_numPeds
,
_numFrames
);
CreateGlobalVariables
(
_numPeds
,
_numFrames
);
...
...
This diff is collapsed.
Click to expand it.
methods/PedData.h
+
1
−
0
View file @
d1239d2d
...
@@ -95,6 +95,7 @@ private:
...
@@ -95,6 +95,7 @@ private:
fs
::
path
_outputLocation
=
""
;
fs
::
path
_outputLocation
=
""
;
int
_minFrame
=
0
;
int
_minFrame
=
0
;
int
_minID
=
1
;
int
_minID
=
1
;
int
_maxID
=
0
;
int
_numFrames
=
0
;
// total number of frames
int
_numFrames
=
0
;
// total number of frames
int
_numPeds
=
0
;
// total number of pedestrians
int
_numPeds
=
0
;
// total number of pedestrians
float
_fps
=
16
;
float
_fps
=
16
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment