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
3a883162
Commit
3a883162
authored
Jul 29, 2016
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove mostly all warnings
parent
7d337875
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
323 additions
and
311 deletions
+323
-311
math/VelocityModel.cpp
math/VelocityModel.cpp
+1
-1
poly2tri/sweep/sweep.cpp
poly2tri/sweep/sweep.cpp
+12
-12
routing/DirectionStrategy.cpp
routing/DirectionStrategy.cpp
+11
-9
routing/FloorfieldViaFM.cpp
routing/FloorfieldViaFM.cpp
+3
-3
routing/FloorfieldViaFM.h
routing/FloorfieldViaFM.h
+1
-1
routing/GlobalRouter.cpp
routing/GlobalRouter.cpp
+13
-14
routing/LocalFloorfieldViaFM.cpp
routing/LocalFloorfieldViaFM.cpp
+19
-20
routing/LocalFloorfieldViaFM.h
routing/LocalFloorfieldViaFM.h
+5
-9
routing/MeshRouter.cpp
routing/MeshRouter.cpp
+12
-12
routing/MeshRouter.h
routing/MeshRouter.h
+1
-1
routing/NavMesh.cpp
routing/NavMesh.cpp
+52
-52
routing/QuickestPathRouter.cpp
routing/QuickestPathRouter.cpp
+8
-8
routing/QuickestPathRouter.h
routing/QuickestPathRouter.h
+4
-3
routing/SafestPathRouter.cpp
routing/SafestPathRouter.cpp
+3
-3
routing/cognitive_map/GraphNetwork.cpp
routing/cognitive_map/GraphNetwork.cpp
+3
-3
routing/cognitive_map/GraphNetwork.h
routing/cognitive_map/GraphNetwork.h
+1
-1
routing/cognitive_map/NavigationGraph.cpp
routing/cognitive_map/NavigationGraph.cpp
+2
-2
routing/cognitive_map/cognitiveMap/cogmapoutputhandler.cpp
routing/cognitive_map/cognitiveMap/cogmapoutputhandler.cpp
+1
-1
routing/cognitive_map/cognitiveMap/cognitivemap.cpp
routing/cognitive_map/cognitiveMap/cognitivemap.cpp
+21
-20
routing/cognitive_map/fire_mesh/FireMeshStorage.cpp
routing/cognitive_map/fire_mesh/FireMeshStorage.cpp
+2
-2
routing/cognitive_map/fire_mesh/FireMeshStorage.h
routing/cognitive_map/fire_mesh/FireMeshStorage.h
+1
-1
routing/cognitive_map/navigation_graph/GraphVertex.cpp
routing/cognitive_map/navigation_graph/GraphVertex.cpp
+6
-2
routing/cognitive_map/sensor/LastDestinationsSensor.cpp
routing/cognitive_map/sensor/LastDestinationsSensor.cpp
+2
-0
routing/cognitive_map/sensor/SensorManager.cpp
routing/cognitive_map/sensor/SensorManager.cpp
+3
-1
routing/cognitive_map/sensor/SensorManager.h
routing/cognitive_map/sensor/SensorManager.h
+2
-2
routing/ffRouter.cpp
routing/ffRouter.cpp
+4
-6
visiLibity/source_code/visilibity.cpp
visiLibity/source_code/visilibity.cpp
+5
-1
visiLibity/source_code/visilibity.hpp
visiLibity/source_code/visilibity.hpp
+3
-0
voronoi-boost/VoronoiPositionGenerator.cpp
voronoi-boost/VoronoiPositionGenerator.cpp
+11
-11
voronoi-boost/VoronoiPositionGenerator.h
voronoi-boost/VoronoiPositionGenerator.h
+5
-4
voronoi/VoronoiDiagramGenerator.cpp
voronoi/VoronoiDiagramGenerator.cpp
+99
-99
voronoi/VoronoiDiagramGenerator.h
voronoi/VoronoiDiagramGenerator.h
+7
-7
No files found.
math/VelocityModel.cpp
View file @
3a883162
...
...
@@ -232,7 +232,7 @@ void VelocityModel::ComputeNextTimeStep(double current, double deltaT, Building*
// calculate min spacing
std
::
sort
(
spacings
.
begin
(),
spacings
.
end
(),
sort_pred
());
double
spacing
=
spacings
[
0
].
first
;
double
winkel
=
spacings
[
0
].
second
;
//
double winkel = spacings[0].second;
Point
tmp
;
Point
speed
=
direction
.
Normalized
()
*
OptimalSpeed
(
ped
,
spacing
);
result_acc
.
push_back
(
speed
);
...
...
poly2tri/sweep/sweep.cpp
View file @
3a883162
...
...
@@ -699,12 +699,12 @@ void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t,
Triangle
&
ot
=
t
->
NeighborAcross
(
p
);
Point
&
op
=
*
ot
.
OppositePoint
(
*
t
,
p
);
if
(
&
ot
==
NULL
)
{
// If we want to integrate the fillEdgeEvent do it here
// With current implementation we should never get here
//throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
assert
(
0
);
}
//
if (&ot == NULL) {
//
// If we want to integrate the fillEdgeEvent do it here
//
// With current implementation we should never get here
//
//throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
//
assert(0);
//
}
if
(
InScanArea
(
p
,
*
t
->
PointCCW
(
p
),
*
t
->
PointCW
(
p
),
op
))
{
// Lets rotate shared edge one vertex CW
...
...
@@ -772,12 +772,12 @@ void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle&
Triangle
&
ot
=
t
.
NeighborAcross
(
p
);
Point
&
op
=
*
ot
.
OppositePoint
(
t
,
p
);
if
(
&
t
.
NeighborAcross
(
p
)
==
NULL
)
{
// If we want to integrate the fillEdgeEvent do it here
// With current implementation we should never get here
//throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
assert
(
0
);
}
//
if (&t.NeighborAcross(p) == NULL) {
//
// If we want to integrate the fillEdgeEvent do it here
//
// With current implementation we should never get here
//
//throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
//
assert(0);
//
}
if
(
InScanArea
(
eq
,
*
flip_triangle
.
PointCCW
(
eq
),
*
flip_triangle
.
PointCW
(
eq
),
op
))
{
// flip with new edge op->eq
...
...
routing/DirectionStrategy.cpp
View file @
3a883162
...
...
@@ -40,6 +40,7 @@
#include <chrono>
#include <ctime>
#define UNUSED(x) [&x]{}() // c++11 silence warnings
DirectionStrategy
::
DirectionStrategy
()
{
...
...
@@ -52,13 +53,13 @@ DirectionStrategy::~DirectionStrategy()
/// 1
Point
DirectionMiddlePoint
::
GetTarget
(
Room
*
room
,
Pedestrian
*
ped
)
const
{
(
void
)
room
;
// suppress the unused warning
UNUSED
(
room
)
;
// suppress the unused warning
return
(
ped
->
GetExitLine
()
->
GetPoint1
()
+
ped
->
GetExitLine
()
->
GetPoint2
())
*
0.5
;
}
/// 2
Point
DirectionMinSeperationShorterLine
::
GetTarget
(
Room
*
room
,
Pedestrian
*
ped
)
const
{
(
void
)
room
;
// suppress the unused warning
UNUSED
(
room
)
;
// suppress the unused warning
double
d
=
ped
->
GetEllipse
().
GetBmin
()
+
0.1
;
// shoulder//0.5;
const
Point
&
p1
=
ped
->
GetExitLine
()
->
GetPoint1
();
...
...
@@ -89,7 +90,7 @@ Point DirectionMinSeperationShorterLine::GetTarget(Room* room, Pedestrian* ped)
/// 3
Point
DirectionInRangeBottleneck
::
GetTarget
(
Room
*
room
,
Pedestrian
*
ped
)
const
{
(
void
)
room
;
// suppress the unused warning
UNUSED
(
room
)
;
// suppress the unused warning
const
Point
&
p1
=
ped
->
GetExitLine
()
->
GetPoint1
();
const
Point
&
p2
=
ped
->
GetExitLine
()
->
GetPoint2
();
...
...
@@ -279,6 +280,7 @@ Point DirectionGeneral::GetTarget(Room* room, Pedestrian* ped) const
/// 6
Point
DirectionFloorfield
::
GetTarget
(
Room
*
room
,
Pedestrian
*
ped
)
const
{
UNUSED
(
room
);
#if DEBUG
if
(
initDone
&&
(
ffviafm
!=
nullptr
))
{
#endif // DEBUG
...
...
@@ -350,6 +352,7 @@ DirectionFloorfield::~DirectionFloorfield() {
/// 7
Point
DirectionGoalFloorfield
::
GetTarget
(
Room
*
room
,
Pedestrian
*
ped
)
const
{
UNUSED
(
room
);
#if DEBUG
if
(
initDone
&&
(
ffviafm
!=
nullptr
))
{
#endif // DEBUG
...
...
@@ -497,8 +500,8 @@ void DirectionLocalFloorfield::Init(Building* buildingArg, double stepsize,
//for (auto& roomPair : building->GetAllRooms()) {
auto
roomPairIt
=
building
->
GetAllRooms
().
begin
();
std
::
advance
(
roomPairIt
,
i
);
locffviafm
[(
*
roomPairIt
).
first
]
=
new
LocalFloorfieldViaFM
((
*
roomPairIt
).
second
.
get
(),
building
,
hx
,
hy
,
wallAvoidDistance
,
useDistancefield
,
"FF_filename"
);
locffviafm
[(
*
roomPairIt
).
first
]
=
new
LocalFloorfieldViaFM
((
*
roomPairIt
).
second
.
get
(),
building
,
hx
,
hy
,
wallAvoidDistance
,
useDistancefield
);
}
end
=
std
::
chrono
::
system_clock
::
now
();
std
::
chrono
::
duration
<
double
>
elapsed_seconds
=
end
-
start
;
...
...
@@ -567,6 +570,7 @@ DirectionLocalFloorfield::~DirectionLocalFloorfield() {
///9
Point
DirectionSubLocalFloorfield
::
GetTarget
(
Room
*
room
,
Pedestrian
*
ped
)
const
{
(
void
)
room
;
// silence warning
#if DEBUG
if
(
initDone
&&
(
ffviafm
!=
nullptr
))
{
#endif // DEBUG
...
...
@@ -642,10 +646,8 @@ void DirectionSubLocalFloorfield::Init(Building* buildingArg, double stepsize,
#pragma omp critical
subUIDs
.
emplace_back
(
subUID
);
Log
->
Write
(
"Creating SubLocFF at key: %d"
,
subUID
);
locffviafm
[
subUID
]
=
new
SubLocalFloorfieldViaFM
(
subroomIt
->
second
.
get
(),
building
,
hx
,
hy
,
wallAvoidDistance
,
useDistancefield
,
"FF_filename"
);
locffviafm
[
subUID
]
=
new
SubLocalFloorfieldViaFM
(
subroomIt
->
second
.
get
(),
building
,
hx
,
hy
,
wallAvoidDistance
,
useDistancefield
);
auto
targets
=
subroomIt
->
second
->
GetAllGoalIDs
();
for
(
auto
targetUID
:
targets
)
{
subAndTarget
.
emplace_back
(
std
::
make_pair
(
subUID
,
targetUID
));
...
...
routing/FloorfieldViaFM.cpp
View file @
3a883162
...
...
@@ -1189,9 +1189,9 @@ void FloorfieldViaFM::setSpeed(bool useDistance2WallArg) {
}
}
void
FloorfieldViaFM
::
setSpeedFromLCGrid
(
double
*
newspeed
)
{
// building->GetGrid()->HALLOHIERBINICHAMMONTAG
}
//
void FloorfieldViaFM::setSpeedFromLCGrid(double* newspeed) {
//
//
building->GetGrid()->HALLOHIERBINICHAMMONTAG
//
}
void
FloorfieldViaFM
::
calculateFloorfield
(
std
::
vector
<
Line
>&
targetlines
,
double
*
costarray
,
Point
*
neggradarray
)
{
calculateFloorfield
(
targetlines
,
costarray
,
neggradarray
,
modifiedspeed
);
...
...
routing/FloorfieldViaFM.h
View file @
3a883162
...
...
@@ -134,7 +134,7 @@ protected:
RectGrid
*
grid
=
nullptr
;
std
::
vector
<
Line
>
wall
;
std
::
vector
<
Line
>
exitsFromScope
;
int
numOfExits
;
unsigned
int
numOfExits
;
const
Building
*
building
;
...
...
routing/GlobalRouter.cpp
View file @
3a883162
...
...
@@ -819,7 +819,7 @@ int GlobalRouter::GetBestDefaultRandomExit(Pedestrian* ped)
int
bestAPsID
=
-
1
;
double
minDistGlobal
=
FLT_MAX
;
double
minDistLocal
=
FLT_MAX
;
//
double minDistLocal = FLT_MAX;
// get the opened exits
SubRoom
*
sub
=
_building
->
GetRoom
(
ped
->
GetRoomID
())
->
GetSubRoom
(
...
...
@@ -829,7 +829,7 @@ int GlobalRouter::GetBestDefaultRandomExit(Pedestrian* ped)
{
AccessPoint
*
ap
=
relevantAPs
[
g
];
if
(
ap
->
isInRange
(
sub
->
GetUID
())
==
false
)
if
(
!
ap
->
isInRange
(
sub
->
GetUID
())
)
continue
;
//check if that exit is open.
if
(
ap
->
IsClosed
())
...
...
@@ -844,7 +844,7 @@ int GlobalRouter::GetBestDefaultRandomExit(Pedestrian* ped)
//check if visible
//only if the room is convex
//otherwise check all rooms at that level
if
(
_building
->
IsVisible
(
posA
,
posC
,
_subroomsAtElevation
[
sub
->
GetElevation
(
sub
->
GetCentroid
())],
true
)
==
false
)
if
(
!
_building
->
IsVisible
(
posA
,
posC
,
_subroomsAtElevation
[
sub
->
GetElevation
(
sub
->
GetCentroid
())],
true
)
)
{
ped
->
RerouteIn
(
10
);
continue
;
...
...
@@ -857,7 +857,7 @@ int GlobalRouter::GetBestDefaultRandomExit(Pedestrian* ped)
{
bestAPsID
=
ap
->
GetID
();
minDistGlobal
=
dist
;
minDistLocal
=
dist2
;
//
minDistLocal=dist2;
}
}
...
...
@@ -888,7 +888,7 @@ int GlobalRouter::GetBestDefaultRandomExit(Pedestrian* ped)
ped
->
RerouteIn
(
5
);
return
relevantAPs
[
0
]
->
GetID
();
}
//
return -1;
return
-
1
;
}
}
...
...
@@ -959,13 +959,13 @@ void GlobalRouter::GetRelevantRoutesTofinalDestination(Pedestrian *ped, vector<A
//the line from the current position to the centre of the nav line.
// at least the line in that direction minus EPS
AccessPoint
*
ap2
=
_accessPoints
[
goals
[
g2
]];
const
Point
&
posA
=
ped
->
GetPos
();
const
Point
&
posB
=
ap2
->
GetNavLine
()
->
GetCentre
();
const
Point
&
posC
=
(
posB
-
posA
).
Normalized
()
*
((
posA
-
posB
).
Norm
()
-
J_EPS
)
+
posA
;
const
Point
&
posA
_
=
ped
->
GetPos
();
const
Point
&
posB
_
=
ap2
->
GetNavLine
()
->
GetCentre
();
const
Point
&
posC
_
=
(
posB_
-
posA_
).
Normalized
()
*
((
posA_
-
posB_
).
Norm
()
-
J_EPS
)
+
posA_
;
//it points to a destination that I can see anyway
if
(
_building
->
IsVisible
(
posA
,
posC
,
_subroomsAtElevation
[
sub
->
GetElevation
(
sub
->
GetCentroid
())],
true
))
//if (sub->IsVisible(posA
, posC
, true) == true)
if
(
_building
->
IsVisible
(
posA
_
,
posC_
,
_subroomsAtElevation
[
sub
->
GetElevation
(
sub
->
GetCentroid
())],
true
))
//if (sub->IsVisible(posA
_, posC_
, true) == true)
{
relevant
=
false
;
}
...
...
@@ -984,9 +984,8 @@ void GlobalRouter::GetRelevantRoutesTofinalDestination(Pedestrian *ped, vector<A
//fallback
if
(
relevantAPS
.
size
()
==
0
)
{
//fixme: this should also never happened. But hap
en due to previv
ous bugs..
//fixme: this should also never happened. But hap
pen due to previ
ous bugs..
const
vector
<
int
>&
goals
=
sub
->
GetAllGoalIDs
();
auto
isinsub
=
sub
->
IsInSubRoom
(
ped
);
for
(
unsigned
int
g1
=
0
;
g1
<
goals
.
size
();
g1
++
)
{
relevantAPS
.
push_back
(
_accessPoints
[
goals
[
g1
]]);
...
...
@@ -1082,8 +1081,8 @@ void GlobalRouter::WriteGraphGV(string filename, int finalDestination,
bool
isSink
=
true
;
for
(
unsigned
int
j
=
0
;
j
<
from_aps
.
size
();
j
++
)
{
int
room_id
=
from_aps
[
j
]
->
GetConnectingRoom1
();
if
(
IsElementInVector
(
rooms_ids
,
room_id
)
==
true
)
int
room_id
_
=
from_aps
[
j
]
->
GetConnectingRoom1
();
if
(
IsElementInVector
(
rooms_ids
,
room_id
_
)
)
{
isSink
=
false
;
break
;
...
...
routing/LocalFloorfieldViaFM.cpp
View file @
3a883162
...
...
@@ -8,8 +8,8 @@ LocalFloorfieldViaFM::LocalFloorfieldViaFM(){};
LocalFloorfieldViaFM
::
LocalFloorfieldViaFM
(
const
Room
*
const
roomArg
,
const
Building
*
buildingArg
,
const
double
hxArg
,
const
double
hyArg
,
const
double
wallAvoidDistance
,
const
bool
useDistancefield
,
const
std
::
string
&
filename
)
{
const
double
wallAvoidDistance
,
const
bool
useDistancefield
)
{
//ctor
threshold
=
-
1
;
//negative value means: ignore threshold
threshold
=
wallAvoidDistance
;
...
...
@@ -44,9 +44,9 @@ void LocalFloorfieldViaFM::getDirectionToDestination(Pedestrian* ped,
return
;
}
void
LocalFloorfieldViaFM
::
getDirectionToGoalID
(
const
int
goalID
){
std
::
cerr
<<
"invalid call to LocalFloorfieldViaFM::getDirectionToGoalID!"
<<
std
::
endl
;
};
//
void LocalFloorfieldViaFM::getDirectionToGoalID(const int goalID){
//
std::cerr << "invalid call to LocalFloorfieldViaFM::getDirectionToGoalID!" << std::endl;
//
};
void
LocalFloorfieldViaFM
::
parseRoom
(
const
Room
*
const
roomArg
,
const
double
hxArg
,
const
double
hyArg
)
...
...
@@ -177,7 +177,7 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
//std::vector<Line> exits(wall.begin(), wall.begin()+numOfExits);
//grid handeling local vars:
long
int
iMax
=
grid
->
GetiMax
();
//
long int iMax = grid->GetiMax();
long
int
iStart
,
iEnd
;
long
int
jStart
,
jEnd
;
...
...
@@ -212,7 +212,7 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
jDot
=
jEnd
;
xe
=
iStart
;
}
crossOutOutsideNeighbors
(
jDot
*
iMax
+
iDot
);
//
crossOutOutsideNeighbors(jDot*iMax + iDot);
for
(
i
=
0
;
iDot
<
xe
;
++
i
)
{
++
iDot
;
if
(
px
<
0
)
{
...
...
@@ -225,7 +225,7 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
}
px
+=
2
*
(
deltaY1
-
deltaX1
);
}
crossOutOutsideNeighbors
(
jDot
*
iMax
+
iDot
);
//
crossOutOutsideNeighbors(jDot*iMax + iDot);
}
}
else
{
if
(
deltaY
>=
0
)
{
...
...
@@ -237,7 +237,7 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
jDot
=
jEnd
;
ye
=
jStart
;
}
crossOutOutsideNeighbors
(
jDot
*
iMax
+
iDot
);
//
crossOutOutsideNeighbors(jDot*iMax + iDot);
for
(
i
=
0
;
jDot
<
ye
;
++
i
)
{
++
jDot
;
if
(
py
<=
0
)
{
...
...
@@ -250,7 +250,7 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
}
py
+=
2
*
(
deltaX1
-
deltaY1
);
}
crossOutOutsideNeighbors
(
jDot
*
iMax
+
iDot
);
//
crossOutOutsideNeighbors(jDot*iMax + iDot);
}
}
}
//loop over all walls
...
...
@@ -282,7 +282,7 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
jDot
=
jEnd
;
xe
=
iStart
;
}
crossOutOutsideNeighbors
(
jDot
*
iMax
+
iDot
);
//
crossOutOutsideNeighbors(jDot*iMax + iDot);
for
(
i
=
0
;
iDot
<
xe
;
++
i
)
{
++
iDot
;
if
(
px
<
0
)
{
...
...
@@ -295,7 +295,7 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
}
px
+=
2
*
(
deltaY1
-
deltaX1
);
}
crossOutOutsideNeighbors
(
jDot
*
iMax
+
iDot
);
//
crossOutOutsideNeighbors(jDot*iMax + iDot);
}
}
else
{
if
(
deltaY
>=
0
)
{
...
...
@@ -307,7 +307,7 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
jDot
=
jEnd
;
ye
=
jStart
;
}
crossOutOutsideNeighbors
(
jDot
*
iMax
+
iDot
);
//
crossOutOutsideNeighbors(jDot*iMax + iDot);
for
(
i
=
0
;
jDot
<
ye
;
++
i
)
{
++
jDot
;
if
(
py
<=
0
)
{
...
...
@@ -320,14 +320,14 @@ void LocalFloorfieldViaFM::drawBlockerLines() {
}
py
+=
2
*
(
deltaX1
-
deltaY1
);
}
crossOutOutsideNeighbors
(
jDot
*
iMax
+
iDot
);
//
crossOutOutsideNeighbors(jDot*iMax + iDot);
}
}
}
//loop over all exits
}
void
LocalFloorfieldViaFM
::
crossOutOutsideNeighbors
(
const
long
int
key
){
//@todo Arne: Is this function needed? delete?
//
void LocalFloorfieldViaFM::crossOutOutsideNeighbors(const long int key){
// directNeighbor dNeigh = grid->getNeighbors(key);
// long int aux = -1;
//
...
...
@@ -406,7 +406,7 @@ void LocalFloorfieldViaFM::crossOutOutsideNeighbors(const long int key){
//// cost[aux] = -8.;
//// }
//// }
}
//
}
int
LocalFloorfieldViaFM
::
isInside
(
const
long
int
key
)
{
int
temp
=
0
;
...
...
@@ -431,8 +431,7 @@ SubLocalFloorfieldViaFM::SubLocalFloorfieldViaFM(){};
SubLocalFloorfieldViaFM
::
SubLocalFloorfieldViaFM
(
const
SubRoom
*
const
roomArg
,
const
Building
*
buildingArg
,
const
double
hxArg
,
const
double
hyArg
,
const
double
wallAvoidDistance
,
const
bool
useDistancefield
,
const
std
::
string
&
filename
)
{
const
double
wallAvoidDistance
,
const
bool
useDistancefield
)
{
//ctor
threshold
=
-
1
;
//negative value means: ignore threshold
threshold
=
wallAvoidDistance
;
...
...
@@ -466,7 +465,7 @@ void SubLocalFloorfieldViaFM::getDirectionToDestination(Pedestrian* ped,
}
void
SubLocalFloorfieldViaFM
::
getDirectionToGoalID
(
const
int
goalID
){
std
::
cerr
<<
"invalid call to SubLocalFloorfieldViaFM::getDirectionToGoalID
!"
<<
std
::
endl
;
std
::
cerr
<<
"invalid call to SubLocalFloorfieldViaFM::getDirectionToGoalID
with goalID: "
<<
goalID
<<
std
::
endl
;
};
...
...
routing/LocalFloorfieldViaFM.h
View file @
3a883162
...
...
@@ -39,14 +39,12 @@
class
LocalFloorfieldViaFM
:
public
FloorfieldViaFM
{
public:
LocalFloorfieldViaFM
();
LocalFloorfieldViaFM
(
const
Room
*
const
room
,
const
Building
*
buildingArg
,
const
double
hxArg
,
const
double
hyArg
,
const
double
wallAvoidDistance
,
const
bool
useDistancefield
,
const
std
::
string
&
filename
);
LocalFloorfieldViaFM
(
const
Room
*
const
room
,
const
Building
*
buildingArg
,
const
double
hxArg
,
const
double
hyArg
,
const
double
wallAvoidDistance
,
const
bool
useDistancefield
);
void
parseRoom
(
const
Room
*
const
roomArg
,
const
double
hxArg
,
const
double
hyArg
);
void
getDirectionToDestination
(
Pedestrian
*
ped
,
Point
&
direction
);
void
getDirectionToGoalID
(
const
int
goalID
);
void
getDirectionToDestination
(
Pedestrian
*
ped
,
Point
&
direction
);
//@todo hides non-virtual function
//
void getDirectionToGoalID(const int goalID);
void
drawBlockerLines
();
void
crossOutOutsideNeighbors
(
const
long
int
key
);
virtual
int
isInside
(
const
long
int
key
);
...
...
@@ -58,9 +56,7 @@ class SubLocalFloorfieldViaFM : public FloorfieldViaFM{
public:
SubLocalFloorfieldViaFM
();
SubLocalFloorfieldViaFM
(
const
SubRoom
*
const
subroom
,
const
Building
*
buildingArg
,
const
double
hxArg
,
const
double
hyArg
,
const
double
wallAvoidDistance
,
const
bool
useDistancefield
,
const
std
::
string
&
filename
);
const
double
hxArg
,
const
double
hyArg
,
const
double
wallAvoidDistance
,
const
bool
useDistancefield
);
void
parseRoom
(
const
SubRoom
*
const
subroomArg
,
const
double
hxArg
,
const
double
hyArg
);
void
getDirectionToDestination
(
Pedestrian
*
ped
,
Point
&
direction
);
...
...
routing/MeshRouter.cpp
View file @
3a883162
...
...
@@ -465,7 +465,7 @@ NavLine MeshRouter::Funnel(Point& start,Point& goal,vector<MeshEdge*> edge_path)
}
//END IF
}
MeshEdge
*
MeshRouter
::
Visibility
(
Point
&
start
,
Point
&
goal
,
vector
<
MeshEdge
*>
edge_path
)
const
MeshEdge
*
MeshRouter
::
Visibility
(
Point
&
start
,
vector
<
MeshEdge
*>
edge_path
)
const
{
//return *(edge_path.begin());
...
...
@@ -601,7 +601,7 @@ vector<MeshEdge*> MeshRouter::AStar(Pedestrian* p,int& status)const
MeshCell
*
nb_cell
=
_meshdata
->
GetCellAtPos
(
nb_id
);
// Calculate
if
(
nb_cell
->
GetEdges
().
size
()
==
3
)
{
//@todo: What happend in this cas?
}
if
(
!
closedlist
[
nb_id
]
&&
length
>
0.2
)
{
// neighbour-cell not fully evaluated
//MeshCell* nb_cell=_meshdata->GetCellAtPos(nb_id);
...
...
@@ -613,8 +613,8 @@ vector<MeshEdge*> MeshRouter::AStar(Pedestrian* p,int& status)const
costlist
[
nb_id
]
=
new_cost
;
inopenlist
[
nb_id
]
=
true
;
double
f
=
new_cost
+
(
nb_cell
->
GetMidpoint
()
-
point_goal
).
Norm
();
openlist
.
push_back
(
make_pair
(
f
,
nb_cell
));
double
f
c
=
new_cost
+
(
nb_cell
->
GetMidpoint
()
-
point_goal
).
Norm
();
openlist
.
push_back
(
make_pair
(
f
c
,
nb_cell
));
}
else
{
if
(
new_cost
<
costlist
[
nb_id
])
{
//cout<<"ERROR"<<endl;
...
...
@@ -624,9 +624,9 @@ vector<MeshEdge*> MeshRouter::AStar(Pedestrian* p,int& status)const
// update nb in openlist
for
(
unsigned
int
j
=
0
;
j
<
openlist
.
size
();
j
++
)
{
if
(
openlist
.
at
(
i
).
second
->
GetID
()
==
nb_id
)
{
MeshCell
*
nb_cell
=
openlist
.
at
(
i
).
second
;
double
f
=
new_cost
+
(
nb_cell
->
GetMidpoint
()
-
point_goal
).
Norm
();
openlist
.
at
(
i
)
=
make_pair
(
f
,
nb_cell
);
MeshCell
*
nb_cell
_
=
openlist
.
at
(
i
).
second
;
double
f
cost
=
new_cost
+
(
nb_cell_
->
GetMidpoint
()
-
point_goal
).
Norm
();
openlist
.
at
(
i
)
=
make_pair
(
f
cost
,
nb_cell_
);
break
;
}
}
...
...
@@ -834,8 +834,8 @@ void MeshRouter::FixMeshEdges()
MeshEdge
*
edge
=
_meshdata
->
GetEdges
().
at
(
i
);
if
(
edge
->
GetRoom1
()
==
NULL
)
{
for
(
int
i
=
0
;
i
<
_building
->
GetNumberOfRooms
();
i
++
)
{
Room
*
room
=
_building
->
GetRoom
(
i
);
for
(
int
numRooms
=
0
;
numRooms
<
_building
->
GetNumberOfRooms
();
numRooms
++
)
{
Room
*
room
=
_building
->
GetRoom
(
numRooms
);
for
(
int
j
=
0
;
j
<
room
->
GetNumberOfSubRooms
();
j
++
)
{
SubRoom
*
sub
=
room
->
GetSubRoom
(
j
);
if
(
sub
->
IsInSubRoom
(
edge
->
GetCentre
()))
{
...
...
@@ -926,10 +926,10 @@ bool MeshRouter::Init(Building* b)
for
(
unsigned
int
i
=
0
;
i
<
countCells
;
i
++
)
{
double
midx
,
midy
;
meshfile
>>
midx
>>
midy
;
unsigned
int
countNodes
=
0
;
meshfile
>>
countNodes
;
unsigned
int
countNodes
_
=
0
;
meshfile
>>
countNodes
_
;
vector
<
int
>
node_id
;
for
(
unsigned
int
j
=
0
;
j
<
countNodes
;
j
++
)
{
for
(
unsigned
int
j
=
0
;
j
<
countNodes
_
;
j
++
)
{
int
tmp
;
meshfile
>>
tmp
;
node_id
.
push_back
(
tmp
);
...
...
routing/MeshRouter.h
View file @
3a883162
...
...
@@ -41,7 +41,7 @@ private:
std
::
vector
<
MeshEdge
*>
AStar
(
Pedestrian
*
p
,
int
&
status
)
const
;
NavLine
Funnel
(
Point
&
,
Point
&
,
std
::
vector
<
MeshEdge
*>
)
const
;
NavLine
FunnelRad
(
Point
&
,
Point
&
,
std
::
vector
<
MeshEdge
*>
);
MeshEdge
*
Visibility
(
Point
&
,
Point
&
,
std
::
vector
<
MeshEdge
*>
)
const
;
MeshEdge
*
Visibility
(
Point
&
,
std
::
vector
<
MeshEdge
*>
)
const
;
std
::
string
GetMeshFileName
()
const
;
void
WriteMeshToFile
(
const
std
::
string
&
filename
);
void
FixMeshEdges
();
...
...
routing/NavMesh.cpp
View file @
3a883162
...
...
@@ -1007,37 +1007,37 @@ void NavMesh::WriteToFile(std::string fileName)
file
<<
ngroup_to_size
[
previousGroup
]
<<
""
;
for
(
unsigned
int
n
=
0
;
n
<
_nodes
.
size
();
n
++
)
{
JNode
*
JNode
=
_nodes
[
n
];
string
actualGroup
=
JNode
->
pGroup
;
JNode
*
JNode
_
=
_nodes
[
n
];
string
actualGroup
=
JNode
_
->
pGroup
;
if
(
actualGroup
!=
previousGroup
)
{
previousGroup
=
actualGroup
;
//file<<"# JNode group"<<endl;
//file<<"# JNode
_
group"<<endl;
file
<<
endl
<<
previousGroup
<<
endl
;
file
<<
ngroup_to_size
[
previousGroup
]
<<
""
;
}
//assert(JNode->pObstacles.size()<20);
//assert(JNode->pPortals.size()<20);
//file<<"nodeid "<<JNode->id<<endl;
//assert(JNode
_
->pObstacles.size()<20);
//assert(JNode
_
->pPortals.size()<20);
//file<<"nodeid "<<JNode
_
->id<<endl;
file
<<
endl
;
file
<<
"
\t
"
<<
JNode
->
pCentroid
.
_x
<<
" "
<<
JNode
->
pCentroid
.
_y
<<
endl
;
file
<<
"
\t
"
<<
JNode
->
pHull
.
size
()
<<
" "
;
for
(
unsigned
int
i
=
0
;
i
<
JNode
->
pHull
.
size
();
i
++
)
{
file
<<
JNode
->
pHull
[
i
].
id
<<
" "
;
file
<<
"
\t
"
<<
JNode
_
->
pCentroid
.
_x
<<
" "
<<
JNode_
->
pCentroid
.
_y
<<
endl
;
file
<<
"
\t
"
<<
JNode
_
->
pHull
.
size
()
<<
" "
;
for
(
unsigned
int
i
=
0
;
i
<
JNode
_
->
pHull
.
size
();
i
++
)
{
file
<<
JNode
_
->
pHull
[
i
].
id
<<
" "
;
}
file
<<
endl
;
file
<<
"
\t
"
<<
JNode
->
pNormalVec
[
0
]
<<
" "
<<
JNode
->
pNormalVec
[
1
]
<<
" "
<<
JNode
->
pNormalVec
[
2
]
<<
endl
;
file
<<
"
\t
"
<<
JNode
_
->
pNormalVec
[
0
]
<<
" "
<<
JNode_
->
pNormalVec
[
1
]
<<
" "
<<
JNode_
->
pNormalVec
[
2
]
<<
endl
;
file
<<
"
\t
"
<<
JNode
->
pPortals
.
size
()
<<
" "
;
for
(
unsigned
int
i
=
0
;
i
<
JNode
->
pPortals
.
size
();
i
++
)
{
file
<<
JNode
->
pPortals
[
i
]
<<
" "
;
file
<<
"
\t
"
<<
JNode
_
->
pPortals
.
size
()
<<
" "
;
for
(
unsigned
int
i
=
0
;
i
<
JNode
_
->
pPortals
.
size
();
i
++
)
{
file
<<
JNode
_
->
pPortals
[
i
]
<<
" "
;
}
file
<<
endl
;
file
<<
"
\t
"
<<
JNode
->
pObstacles
.
size
()
<<
" "
;
for
(
unsigned
int
i
=
0
;
i
<
JNode
->
pObstacles
.
size
();
i
++
)
{
file
<<
JNode
->
pObstacles
[
i
]
<<
" "
;
file
<<
"
\t
"
<<
JNode
_
->
pObstacles
.
size
()
<<
" "
;
for
(
unsigned
int
i
=
0
;
i
<
JNode
_
->
pObstacles
.
size
();
i
++
)
{
file
<<
JNode
_
->
pObstacles
[
i
]
<<
" "
;
}
file
<<
endl
;
...
...
@@ -1415,10 +1415,10 @@ void NavMesh::FinalizeAlphaShape()
for
(
int
index
=
0
;
index
<
3
;
index
++
)
{
Point
P0
=
Point
(
tr
->
GetPoint
(
index
%
3
)
->
x
,
tr
->
GetPoint
(
index
%
3
)
->
y
);
Point
P1
=
Point
(
tr
->
GetPoint
((
index
+
1
)
%
3
)
->
x
,
tr
->
GetPoint
((
index
+
1
)
%
3
)
->
y
);
Point
P0
_
=
Point
(
tr
->
GetPoint
(
index
%
3
)
->
x
,
tr
->
GetPoint
(
index
%
3
)
->
y
);
Point
P1
_
=
Point
(
tr
->
GetPoint
((
index
+
1
)
%
3
)
->
x
,
tr
->
GetPoint
((
index
+
1
)
%
3
)
->
y
);
int
edge_id
=
IsPortal
(
P0
,
P1
);
int
edge_id
=
IsPortal
(
P0
_
,
P1_
);
if
(
edge_id
!=
-
1
)
{
//if(IsElementInVector(new_node->pPortals,edge_id)==false)
new_node
->
pPortals
.
push_back
(
edge_id
);
...
...
@@ -1430,7 +1430,7 @@ void NavMesh::FinalizeAlphaShape()
e
->
pNode1
=-
1
;
}
int
obstacle_id
=
IsObstacle
(
P0
,
P1
);
int
obstacle_id
=
IsObstacle
(
P0
_
,
P1_
);
if
(
obstacle_id
!=
-
1
)
{
//std::cerr<<"Error: the convexification has created an JObstacle"<<endl;
//if(IsElementInVector(new_node->pObstacles,obstacle_id)==false)
...
...
@@ -1442,8 +1442,8 @@ void NavMesh::FinalizeAlphaShape()
if
((
obstacle_id
==-
1
)
&&
(
edge_id
==-
1
))
{
JEdge
*
e
=
new
JEdge
();
e
->
pEnd
=*
GetVertex
(
P1
);
e
->
pStart
=
*
GetVertex
(
P0
);
e
->
pEnd
=*
GetVertex
(
P1
_
);
e
->
pStart
=
*
GetVertex
(
P0
_
);
AddEdge
(
e
);
//invalidate any previous information
...
...
@@ -1509,10 +1509,10 @@ void NavMesh::Finalize()
for
(
unsigned
w
=
0
;
w
<
walls
.
size
();
w
++
)
{
bool
skip
=
false
;
for
(
unsigned
int
i
=
0
;
i
<
centroids
.
size
();
i
++
)
{
if
(
walls
[
w
].
DistTo
(
centroids
[
i
])
<
25
)
skip
=
true
;
for
(
unsigned
int
j
=
0
;
j
<
centroids
.
size
();
j
++
)
{
if
(
walls
[
w
].
DistTo
(
centroids
[
j
])
<
25
)
skip
=
true
;
}
if
(
skip
==
true
)
continue
;
if
(
skip
)
continue
;
//first attempt
Point
P0
=
walls
[
w
].
GetPoint1
();
...
...
@@ -1533,10 +1533,10 @@ void NavMesh::Finalize()
if
(
transitions
[
t
]
->
GetSubRoom2
()
!=
NULL
)
continue
;
bool
skip
=
false
;
for
(
unsigned
int
i
=
0
;
i
<
centroids
.
size
();
i
++
)
{
if
(
transitions
[
t
]
->
DistTo
(
centroids
[
i
])
<
25
)
skip
=
true
;
for
(
unsigned
int
c
=
0
;
c
<
centroids
.
size
();
c
++
)
{
if
(
transitions
[
t
]
->
DistTo
(
centroids
[
c
])
<
25
)
skip
=
true
;
}
if
(
skip
==
true
)
continue
;
if
(
skip
)
continue
;
//first attempt
Point
P0
=
transitions
[
t
]
->
GetPoint1
();
...
...
@@ -1677,10 +1677,10 @@ void NavMesh::Finalize()
for
(
int
index
=
0
;
index
<
3
;
index
++
)
{
Point
P0
=
Point
(
tr
->
GetPoint
(
index
%
3
)
->
x
,
tr
->
GetPoint
(
index
%
3
)
->
y
);
Point
P1
=
Point
(
tr
->
GetPoint
((
index
+
1
)
%
3
)
->
x
,
tr
->
GetPoint
((
index
+
1
)
%
3
)
->
y
);
Point
P0
_
=
Point
(
tr
->
GetPoint
(
index
%
3
)
->
x
,
tr
->
GetPoint
(
index
%
3
)
->
y
);
Point
P1
_
=
Point
(
tr
->
GetPoint
((
index
+
1
)
%
3
)
->
x
,
tr
->
GetPoint
((
index
+
1
)
%
3
)
->
y
);
int
edge_id
=
IsPortal
(
P0
,
P1
);
int
edge_id
=
IsPortal
(
P0
_
,
P1_
);
if
(
edge_id
!=
-
1
)
{
//if(IsElementInVector(new_node->pPortals,edge_id)==false)
new_node
->
pPortals
.
push_back
(
edge_id
);
...
...
@@ -1692,7 +1692,7 @@ void NavMesh::Finalize()
e
->
pNode1
=-
1
;
}
int
obstacle_id
=
IsObstacle
(
P0
,
P1
);
int
obstacle_id
=
IsObstacle
(
P0
_
,
P1_
);