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
736c6262
Commit
736c6262
authored
Jun 25, 2015
by
Arne Graf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using ini files with floorfield
parent
17466e2b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
14 deletions
+71
-14
general/ArgumentParser.cpp
general/ArgumentParser.cpp
+35
-1
general/ArgumentParser.h
general/ArgumentParser.h
+3
-0
inputfiles/Bottleneck/2.5_ini-Bottleneck.xml
inputfiles/Bottleneck/2.5_ini-Bottleneck.xml
+3
-2
math/GradientModel.cpp
math/GradientModel.cpp
+7
-4
math/GradientModel.h
math/GradientModel.h
+6
-1
pedestrian/Pedestrian.cpp
pedestrian/Pedestrian.cpp
+1
-1
routing/DirectionStrategy.cpp
routing/DirectionStrategy.cpp
+12
-2
routing/DirectionStrategy.h
routing/DirectionStrategy.h
+1
-0
routing/FloorfieldViaFM.cpp
routing/FloorfieldViaFM.cpp
+3
-3
No files found.
general/ArgumentParser.cpp
View file @
736c6262
...
...
@@ -716,6 +716,39 @@ bool ArgumentParser::ParseGradientModel(TiXmlElement* xGradient) // @todo: chang
if
(
ParseStrategyNodeToObject
(
*
xModelPara
)
==
false
)
return
false
;
//floorfield
if
(
xModelPara
->
FirstChild
(
"floorfield"
))
{
if
(
!
xModelPara
->
FirstChildElement
(
"floorfield"
)
->
Attribute
(
"delta_h"
))
pDeltaH
=
0.0625
;
// default value
else
{
string
delta_h
=
xModelPara
->
FirstChildElement
(
"floorfield"
)
->
Attribute
(
"delta_h"
);
pDeltaH
=
atof
(
delta_h
.
c_str
());
}
if
(
!
xModelPara
->
FirstChildElement
(
"floorfield"
)
->
Attribute
(
"wall_avoid_distance"
))
pWallAvoidDistance
=
.8
;
// default value
else
{
string
wall_avoid_distance
=
xModelPara
->
FirstChildElement
(
"floorfield"
)
->
Attribute
(
"wall_avoid_distance"
);
pWallAvoidDistance
=
atof
(
wall_avoid_distance
.
c_str
());
}
if
(
!
xModelPara
->
FirstChildElement
(
"floorfield"
)
->
Attribute
(
"use_wall_avoidance"
))
pUseWallAvoidance
=
true
;
// default value
else
{
string
use_wall_avoidance
=
xModelPara
->
FirstChildElement
(
"floorfield"
)
->
Attribute
(
"use_wall_avoidance"
);
if
(
use_wall_avoidance
==
"false"
)
pUseWallAvoidance
=
false
;
else
pUseWallAvoidance
=
true
;
}
Log
->
Write
(
"INFO:
\t
floorfield <delta h=%0.4f, wall avoid distance=%0.2f>"
,
pDeltaH
,
pWallAvoidDistance
);
Log
->
Write
(
"INFO:
\t
floorfield <use wall avoidance=%s>"
,
pUseWallAvoidance
?
"true"
:
"false"
);
}
//linked-cells
if
(
ParseLinkedCells
(
*
xModelPara
)
==
false
)
return
false
;
...
...
@@ -784,7 +817,8 @@ bool ArgumentParser::ParseGradientModel(TiXmlElement* xGradient) // @todo: chang
p_op_model
=
std
::
shared_ptr
<
OperationalModel
>
(
new
GradientModel
(
p_exit_strategy
.
get
(),
this
->
GetNuPed
(),
this
->
GetaPed
(),
this
->
GetbPed
(),
this
->
GetcPed
(),
this
->
GetNuWall
(),
this
->
GetaWall
(),
this
->
GetbWall
(),
this
->
GetcWall
()));
this
->
GetcWall
(),
this
->
pDeltaH
,
this
->
pWallAvoidDistance
,
this
->
pUseWallAvoidance
));
return
true
;
}
...
...
general/ArgumentParser.h
View file @
736c6262
...
...
@@ -96,6 +96,9 @@ private:
unsigned
int
pSeed
;
int
pSolver
;
/// solver for the differential equation
int
pExitStrategy
;
// Strategie zur Richtungswahl (v0)
double
pDeltaH
;
double
pWallAvoidDistance
;
bool
pUseWallAvoidance
;
int
pLog
;
int
pPort
;
int
_embedMesh
;
...
...
inputfiles/Bottleneck/2.5_ini-Bottleneck.xml
View file @
736c6262
...
...
@@ -82,9 +82,10 @@ xsi:noNamespaceSchemaLocation="http://134.94.2.137/jps_ini_core.xsd">
<solver>
euler
</solver>
<stepsize>
0.01
</stepsize>
<exit_crossing_strategy>
6
</exit_crossing_strategy>
<floorfield
delta_h=
"0.0625"
wall_avoid_distance=
"0.8"
use_wall_avoidance=
"true"
/>
<linkedcells
enabled=
"true"
cell_size=
"2.2"
/>
<force_ped
nu=
"
3
"
b=
"0.25"
c=
"3.0"
/>
<force_wall
nu=
"1
0
"
b=
"0.70"
c=
"3.0"
/>
<force_ped
nu=
"
0
"
b=
"0.25"
c=
"3.0"
/>
<force_wall
nu=
"1"
b=
"0.70"
c=
"3.0"
/>
</model_parameters>
<agent_parameters
agent_parameter_id=
"1"
>
<v0
mu=
"0.5"
sigma=
"0.0"
/>
...
...
math/GradientModel.cpp
View file @
736c6262
...
...
@@ -48,7 +48,8 @@ using std::vector;
using
std
::
string
;
GradientModel
::
GradientModel
(
DirectionStrategy
*
dir
,
double
nuped
,
double
aped
,
double
bped
,
double
cped
,
double
nuwall
,
double
awall
,
double
bwall
,
double
cwall
)
double
nuwall
,
double
awall
,
double
bwall
,
double
cwall
,
double
deltaH
,
double
wallAvoidDistance
,
bool
useWallAvoidance
)
{
_direction
=
dir
;
// Force_rep_PED Parameter
...
...
@@ -61,6 +62,10 @@ GradientModel::GradientModel(DirectionStrategy* dir, double nuped, double aped,
_aWall
=
awall
;
_bWall
=
bwall
;
_cWall
=
cwall
;
// floorfield Parameter
_deltaH
=
deltaH
;
_wallAvoidDistance
=
wallAvoidDistance
;
_useWallAvoidance
=
useWallAvoidance
;
}
...
...
@@ -71,10 +76,8 @@ GradientModel::~GradientModel()
bool
GradientModel
::
Init
(
Building
*
building
)
const
{
//_direction = DirectionFloorfield(building, .0625, 1., true);
if
(
dynamic_cast
<
DirectionFloorfield
*>
(
_direction
)){
dynamic_cast
<
DirectionFloorfield
*>
(
_direction
)
->
Init
(
building
,
.0625
,
.5
,
tru
e
);
dynamic_cast
<
DirectionFloorfield
*>
(
_direction
)
->
Init
(
building
,
_deltaH
,
_wallAvoidDistance
,
_useWallAvoidanc
e
);
}
const
vector
<
Pedestrian
*
>&
allPeds
=
building
->
GetAllPedestrians
();
...
...
math/GradientModel.h
View file @
736c6262
...
...
@@ -58,6 +58,10 @@ private:
double
_bWall
;
double
_cWall
;
double
_deltaH
;
double
_wallAvoidDistance
;
bool
_useWallAvoidance
;
/**
* Driving force \f$ F_i =\frac{\mathbf{v_0}-\mathbf{v_i}}{\tau}\f$
* This is a duplicate of @see GCFMModel::ForceDriv
...
...
@@ -101,7 +105,8 @@ private:
public:
GradientModel
(
DirectionStrategy
*
dir
,
double
nuped
,
double
aped
,
double
bped
,
double
cped
,
double
nuwall
,
double
awall
,
double
bwall
,
double
cwall
);
double
nuwall
,
double
awall
,
double
bwall
,
double
cwall
,
double
deltaH
,
double
wallAvoidDistance
,
bool
useWallAvoidance
);
virtual
~
GradientModel
(
void
);
DirectionStrategy
*
GetDirection
()
const
;
...
...
pedestrian/Pedestrian.cpp
View file @
736c6262
...
...
@@ -455,7 +455,7 @@ const Point& Pedestrian::GetV0(const Point& target)
//new_v0 = delta.NormalizedMolified();
new_v0
=
delta
.
Normalized
();
// -------------------------------------- Handover new target
t
=
_newOrientationDelay
++
*
_deltaT
/
(
1.0
+
1000
*
_distToBlockade
);
t
=
_newOrientationDelay
++
*
_deltaT
/
(
1.0
+
1000
*
_distToBlockade
);
_V0
=
_V0
+
(
new_v0
-
_V0
)
*
(
1
-
exp
(
-
t
/
_tau
)
);
#if DEBUG
...
...
routing/DirectionStrategy.cpp
View file @
736c6262
...
...
@@ -256,11 +256,18 @@ Point DirectionInRangeBottleneck::GetTarget(Room* room, Pedestrian* ped) const
/// 6
Point
DirectionFloorfield
::
GetTarget
(
Room
*
room
,
Pedestrian
*
ped
)
const
{
if
(
ffviafm
!=
nullptr
)
{
#if DEBUG
if
(
initDone
&&
(
ffviafm
!=
nullptr
))
{
#endif // DEBUG
Point
p
;
ffviafm
->
getDirectionAt
(
ped
->
GetPos
(),
p
);
return
p
;
#if DEBUG
}
#endif // DEBUG
//this should not execute:
exit
(
EXIT_FAILURE
);
}
...
...
@@ -268,9 +275,12 @@ Point DirectionFloorfield::GetTarget(Room* room, Pedestrian* ped) const
void
DirectionFloorfield
::
Init
(
Building
*
building
,
double
stepsize
,
double
threshold
,
bool
useDistancMap
)
{
//implement mechanic, that can read-in an existing floorfield (from a previous run)
ffviafm
=
new
FloorfieldViaFM
(
building
,
stepsize
,
stepsize
,
threshold
,
useDistancMap
);
initDone
=
true
;
}
DirectionFloorfield
::
DirectionFloorfield
()
{};
DirectionFloorfield
::
DirectionFloorfield
()
{
initDone
=
false
;
};
DirectionFloorfield
::~
DirectionFloorfield
()
{
if
(
ffviafm
)
{
...
...
routing/DirectionStrategy.h
View file @
736c6262
...
...
@@ -81,6 +81,7 @@ public:
private:
FloorfieldViaFM
*
ffviafm
;
bool
initDone
;
};
#endif
/* _DIRECTIONSTRATEGY_H */
...
...
routing/FloorfieldViaFM.cpp
View file @
736c6262
...
...
@@ -800,8 +800,8 @@ void FloorfieldViaFM::testoutput(const char* filename1, const char* filename2, c
int
numX
=
(
int
)
((
grid
->
GetxMax
()
-
grid
->
GetxMin
())
/
grid
->
Gethx
());
int
numY
=
(
int
)
((
grid
->
GetyMax
()
-
grid
->
GetyMin
())
/
grid
->
Gethy
());
int
numTotal
=
numX
*
numY
;
std
::
cerr
<<
numTotal
<<
" numTotal"
<<
std
::
endl
;
std
::
cerr
<<
grid
->
GetnPoints
()
<<
" grid"
<<
std
::
endl
;
//
std::cerr << numTotal << " numTotal" << std::endl;
//
std::cerr << grid->GetnPoints() << " grid" << std::endl;
file
.
open
(
filename1
);
file2
.
open
(
filename2
);
file
<<
"# vtk DataFile Version 3.0"
<<
std
::
endl
;
...
...
@@ -834,6 +834,6 @@ void FloorfieldViaFM::testoutput(const char* filename1, const char* filename2, c
file
.
close
();
file2
.
close
();
std
::
cerr
<<
"File closed: "
<<
filename1
<<
std
::
endl
;
std
::
cerr
<<
"
INFO:
\t
File closed: "
<<
filename1
<<
std
::
endl
;
}
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