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
f38f6093
Commit
f38f6093
authored
Jul 24, 2017
by
Arne Graf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning
parent
d65740a5
Pipeline
#3878
passed with stages
in 5 minutes and 42 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
9 deletions
+27
-9
routing/ff_router/UnivFFviaFM.cpp
routing/ff_router/UnivFFviaFM.cpp
+23
-7
routing/ff_router/UnivFFviaFM.h
routing/ff_router/UnivFFviaFM.h
+2
-1
routing/ff_router/ffRouter.cpp
routing/ff_router/ffRouter.cpp
+2
-1
No files found.
routing/ff_router/UnivFFviaFM.cpp
View file @
f38f6093
...
...
@@ -91,9 +91,12 @@ UnivFFviaFM::UnivFFviaFM(Room* roomArg, Configuration* const confArg, double hx,
}
}
}
create
(
lines
,
tmpDoors
,
wantedDoors
,
FF_HOMO_SPEED
,
hx
,
wallAvoid
,
useWallDistances
);
//create(lines, tmpDoors, wantedDoors, FF_WALL_AVOID, hx, wallAvoid, useWallDistances);
//this will interpret "useWallDistances" as best as possible. Users should clearify with "setSpeedMode" before calling "AddTarget"
if
(
useWallDistances
)
{
create
(
lines
,
tmpDoors
,
wantedDoors
,
FF_WALL_AVOID
,
hx
,
wallAvoid
,
useWallDistances
);
}
else
{
create
(
lines
,
tmpDoors
,
wantedDoors
,
FF_HOMO_SPEED
,
hx
,
wallAvoid
,
useWallDistances
);
}
}
UnivFFviaFM
::
UnivFFviaFM
(
SubRoom
*
sr
,
Configuration
*
const
conf
,
double
hx
,
double
wallAvoid
,
bool
useWallDistances
)
...
...
@@ -135,7 +138,12 @@ UnivFFviaFM::UnivFFviaFM(SubRoom* subRoomArg, Configuration* const confArg, doub
tmpDoors
.
emplace
(
std
::
make_pair
(
uidNotConst
,
(
Line
)
*
trans
));
}
create
(
lines
,
tmpDoors
,
wantedDoors
,
FF_HOMO_SPEED
,
hx
,
wallAvoid
,
useWallDistances
);
//this will interpret "useWallDistances" as best as possible. Users should clearify with "setSpeedMode" before calling "AddTarget"
if
(
useWallDistances
)
{
create
(
lines
,
tmpDoors
,
wantedDoors
,
FF_WALL_AVOID
,
hx
,
wallAvoid
,
useWallDistances
);
}
else
{
create
(
lines
,
tmpDoors
,
wantedDoors
,
FF_HOMO_SPEED
,
hx
,
wallAvoid
,
useWallDistances
);
}
}
void
UnivFFviaFM
::
create
(
std
::
vector
<
Line
>&
walls
,
std
::
map
<
int
,
Line
>&
doors
,
std
::
vector
<
int
>
targetUIDs
,
int
mode
,
...
...
@@ -995,7 +1003,7 @@ void UnivFFviaFM::addTarget(const int uid, double* costarrayDBL, Point* gradarra
if
(
_mode
==
CENTERPOINT
)
{
newArrayDBL
[
_grid
->
getKeyAtPoint
(
tempCenterPoint
)]
=
magicnum
(
TARGET_REGION
);
}
//the following condition is not clean: we have _speedmode and _useWallDistances which are redundant
if
(
_speedmode
==
FF_WALL_AVOID
)
{
calcFF
(
newArrayDBL
,
newArrayPt
,
_speedFieldSelector
[
REDU_WALL_SPEED
]);
}
else
if
(
_speedmode
==
FF_HOMO_SPEED
)
{
...
...
@@ -1074,6 +1082,10 @@ void UnivFFviaFM::setMode(int modeArg) {
_mode
=
modeArg
;
}
void
UnivFFviaFM
::
setSpeedMode
(
int
speedModeArg
)
{
_speedmode
=
speedModeArg
;
}
void
UnivFFviaFM
::
writeFF
(
const
std
::
string
&
filename
,
std
::
vector
<
int
>
targetID
)
{
Log
->
Write
(
"INFO:
\t
Write Floorfield to file"
);
...
...
@@ -1290,14 +1302,18 @@ void UnivFFviaFM::getDirectionToUID(int destID, const long int key, Point& direc
double
UnivFFviaFM
::
getDistance2WallAt
(
const
Point
&
pos
)
{
if
(
_useWallDistances
||
(
_speedmode
==
FF_WALL_AVOID
))
{
return
_costFieldWithKey
[
0
][
_grid
->
getKeyAtPoint
(
pos
)];
if
(
_costFieldWithKey
[
0
])
{
return
_costFieldWithKey
[
0
][
_grid
->
getKeyAtPoint
(
pos
)];
}
}
return
DBL_MAX
;
}
void
UnivFFviaFM
::
getDir2WallAt
(
const
Point
&
pos
,
Point
&
p
)
{
if
(
_useWallDistances
||
(
_speedmode
==
FF_WALL_AVOID
))
{
p
=
_directionFieldWithKey
[
0
][
_grid
->
getKeyAtPoint
(
pos
)];
if
(
_directionFieldWithKey
[
0
])
{
p
=
_directionFieldWithKey
[
0
][
_grid
->
getKeyAtPoint
(
pos
)];
}
}
else
{
p
=
Point
(
0.0
,
0.0
);
}
...
...
routing/ff_router/UnivFFviaFM.h
View file @
f38f6093
...
...
@@ -98,6 +98,7 @@ public:
std
::
vector
<
int
>
getKnownDoorUIDs
();
void
setUser
(
int
userArg
);
void
setMode
(
int
modeArg
);
void
setSpeedMode
(
int
speedModeArg
);
SubRoom
**
getSubRoomFF
();
SubRoom
*
getSubRoom
(
const
Point
&
pos
);
...
...
@@ -150,7 +151,7 @@ private:
SubRoom
*
*
_subrooms
=
nullptr
;
// this is an array (first asterisk) of pointers (second asterisk)
double
_wallAvoidDistance
=
0.
;
bool
_useWallDistances
=
false
;
bool
_useWallDistances
=
false
;
//could be used in DirectionStrategy even if mode _speedmode is FF_HOMO_SPEED
//the following maps are responsible for dealloc the arrays
std
::
map
<
int
,
double
*>
_costFieldWithKey
;
...
...
routing/ff_router/ffRouter.cpp
View file @
f38f6093
...
...
@@ -189,6 +189,7 @@ bool FFRouter::Init(Building* building)
// }
locffptr
->
setUser
(
DISTANCE_AND_DIRECTIONS_USED
);
locffptr
->
setMode
(
CENTERPOINT
);
locffptr
->
setSpeedMode
(
FF_HOMO_SPEED
);
locffptr
->
addAllTargetsParallel
();
locffptr
->
writeFF
(
"UnivFF"
+
std
::
to_string
(
pairRoomIt
->
first
)
+
".vtk"
,
locffptr
->
getKnownDoorUIDs
());
Log
->
Write
(
"INFO:
\t
Adding distances in Room %d to matrix"
,
(
*
pairRoomIt
).
first
);
...
...
@@ -517,7 +518,7 @@ int FFRouter::FindExit(Pedestrian* p)
#pragma omp critical(finalDoors)
_finalDoors
.
emplace
(
std
::
make_pair
(
p
->
GetID
(),
bestFinalDoor
));
if
(
_CroTrByUID
.
count
(
bestDoor
))
{
p
->
SetExitIndex
(
bestDoor
);
p
->
SetExitLine
(
_CroTrByUID
.
at
(
bestDoor
));
...
...
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