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
b1345915
Commit
b1345915
authored
Apr 13, 2018
by
Arne Graf
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed ff_router that deleted agents on doors, or had them stop on doors
parent
9e55b84f
Pipeline
#8668
failed with stages
in 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
3 deletions
+32
-3
routing/ff_router/UnivFFviaFM.cpp
routing/ff_router/UnivFFviaFM.cpp
+32
-3
No files found.
routing/ff_router/UnivFFviaFM.cpp
View file @
b1345915
...
...
@@ -1190,6 +1190,11 @@ void UnivFFviaFM::addTarget(const int uid, double* costarrayDBL, Point* gradarra
}
else
if
(
_speedmode
==
FF_PED_SPEED
)
{
calcFF
(
newArrayDBL
,
newArrayPt
,
_speedFieldSelector
[
PED_SPEED
]);
}
//the rest of the door must be initialized if centerpoint was used. else ff_router will have probs getting localDist
if
(
_mode
==
CENTERPOINT
)
{
drawLinesOnGrid
(
tempTargetLine
,
newArrayDBL
,
magicnum
(
TARGET_REGION
));
}
#pragma omp critical(_uids)
_uids
.
emplace_back
(
uid
);
}
...
...
@@ -1418,8 +1423,20 @@ double UnivFFviaFM::getCostToDestination(const int destID, const Point& position
// Log->Write("Was ist denn hier los?");
// }
assert
(
_grid
->
includesPoint
(
position
));
long
int
key
=
_grid
->
getKeyAtPoint
(
position
);
if
(
_gridCode
[
key
]
==
OUTSIDE
)
{
//bresenham line (treppenstruktur) at middle and calculated centre of line are on different gridpoints
//find a key that belongs domain (must be one left or right and second one below or above)
if
(
_gridCode
[
key
+
1
]
!=
OUTSIDE
)
{
key
=
key
+
1
;
}
else
if
(
_gridCode
[
key
-
1
]
!=
OUTSIDE
){
key
=
key
-
1
;
}
else
{
Log
->
Write
(
"ERROR:
\t
In getCostToDestination(3 args)"
);
}
}
if
(
_costFieldWithKey
.
count
(
destID
)
==
1
&&
_costFieldWithKey
[
destID
])
{
return
_costFieldWithKey
[
destID
][
_grid
->
getKeyAtPoint
(
position
)
];
return
_costFieldWithKey
[
destID
][
key
];
}
else
if
(
_directCalculation
&&
_doors
.
count
(
destID
)
>
0
)
{
_costFieldWithKey
[
destID
]
=
new
double
[
_nPoints
];
if
(
_user
==
DISTANCE_AND_DIRECTIONS_USED
)
{
...
...
@@ -1440,8 +1457,20 @@ double UnivFFviaFM::getCostToDestination(const int destID, const Point& position
double
UnivFFviaFM
::
getCostToDestination
(
const
int
destID
,
const
Point
&
position
)
{
assert
(
_grid
->
includesPoint
(
position
));
long
int
key
=
_grid
->
getKeyAtPoint
(
position
);
if
(
_gridCode
[
key
]
==
OUTSIDE
)
{
//bresenham line (treppenstruktur) getKeyAtPoint yields gridpoint next to edge, although position is on edge
//find a key that belongs domain (must be one left or right and second one below or above)
if
(
_gridCode
[
key
+
1
]
!=
OUTSIDE
)
{
key
=
key
+
1
;
}
else
if
(
_gridCode
[
key
-
1
]
!=
OUTSIDE
){
key
=
key
-
1
;
}
else
{
Log
->
Write
(
"ERROR:
\t
In getCostToDestination(2 args)"
);
}
}
if
(
_costFieldWithKey
.
count
(
destID
)
==
1
&&
_costFieldWithKey
[
destID
])
{
return
_costFieldWithKey
[
destID
][
_grid
->
getKeyAtPoint
(
position
)
];
return
_costFieldWithKey
[
destID
][
key
];
}
else
if
(
_directCalculation
&&
_doors
.
count
(
destID
)
>
0
)
{
_costFieldWithKey
[
destID
]
=
new
double
[
_nPoints
];
if
(
_user
==
DISTANCE_AND_DIRECTIONS_USED
)
{
...
...
@@ -1467,7 +1496,7 @@ double UnivFFviaFM::getDistanceBetweenDoors(const int door1_ID, const int door2_
if
(
_costFieldWithKey
.
count
(
door1_ID
)
==
1
&&
_costFieldWithKey
[
door1_ID
])
{
long
int
key
=
_grid
->
getKeyAtPoint
(
_doors
.
at
(
door2_ID
).
GetCentre
());
if
(
_gridCode
[
key
]
!=
door2_ID
)
{
//bresenham line (treppenstruktur)
at middle and calculated centre of line are on different keys
//bresenham line (treppenstruktur)
getKeyAtPoint yields gridpoint next to edge, although position is on edge
//find a key that belongs to door (must be one left or right and second one below or above)
if
(
_gridCode
[
key
+
1
]
==
door2_ID
)
{
key
=
key
+
1
;
...
...
Arne Graf
@graf2
mentioned in issue
#269 (closed)
·
Apr 13, 2018
mentioned in issue
#269 (closed)
mentioned in issue #269
Toggle commit list
Arne Graf
@graf2
mentioned in commit
c5f458f6
·
Apr 16, 2018
mentioned in commit
c5f458f6
mentioned in commit c5f458f68bc3dda3191017932843be0d1a79a865
Toggle commit list
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