Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
8b4bd96d
Commit
8b4bd96d
authored
Jan 24, 2019
by
Benedikt Zoennchen
Browse files
remove the old busy implementation of minStepSize and insert the new lazy one.
parent
bc9f5c0f
Pipeline
#86538
failed with stages
in 54 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/models/osm/PedestrianOSM.java
View file @
8b4bd96d
...
...
@@ -143,6 +143,10 @@ public class PedestrianOSM extends Pedestrian {
refreshRelevantPedestrians
();
nextPosition
=
stepCircleOptimizer
.
getNextPosition
(
this
,
reachableArea
);
if
(
attributesOSM
.
isMinimumStepLength
()
&&
getPosition
().
distance
(
nextPosition
)
<
minStepLength
)
{
nextPosition
=
getPosition
();
}
}
else
{
stairStepOptimizer
=
new
StairStepOptimizer
(
stairs
);
reachableArea
=
new
VCircle
(
getPosition
(),
stairs
.
getTreadDepth
()
*
1.99
);
...
...
@@ -154,10 +158,6 @@ public class PedestrianOSM extends Pedestrian {
}
}
/*if(attributesOSM.isMinimumStepLength() && getPosition().distance(nextPosition) < minStepLength) {
nextPosition = getPosition();
}*/
}
/**
...
...
VadereSimulator/src/org/vadere/simulator/models/osm/optimization/PotentialEvaluationFunction.java
View file @
8b4bd96d
...
...
@@ -134,9 +134,7 @@ public class PotentialEvaluationFunction implements UnivariateRealFunction,
}
}
if
(
Math
.
pow
(
newPos
.
x
-
pedPos
.
x
,
2
)
+
Math
.
pow
(
newPos
.
y
-
pedPos
.
y
,
2
)
<=
Math
.
pow
(
stepSize
,
2
)
+
0.00001
&&
Math
.
pow
(
newPos
.
x
-
pedPos
.
x
,
2
)
+
Math
.
pow
(
newPos
.
y
-
pedPos
.
y
,
2
)
>=
Math
.
pow
(
this
.
minStepSize
,
2
)
-
0.00001
)
{
if
(
Math
.
pow
(
newPos
.
x
-
pedPos
.
x
,
2
)
+
Math
.
pow
(
newPos
.
y
-
pedPos
.
y
,
2
)
<=
Math
.
pow
(
stepSize
,
2
)
+
0.00001
)
{
result
=
pedestrian
.
getPotential
(
newPos
);
}
counter
++;
...
...
VadereState/src/org/vadere/state/attributes/models/AttributesOSM.java
View file @
8b4bd96d
...
...
@@ -13,23 +13,107 @@ import org.vadere.state.types.UpdateType;
@ModelAttributeClass
public
class
AttributesOSM
extends
Attributes
{
/**
* <p>
* Parameter of the optimization method: the number of points on the most outer circle.
* These points will be used in different ways which depends on the {@link OptimizationType}.
* </p>
* <ul>
* <li>OptimizationType.NELDER_MEAD (default): each neighbouring pair of points and the agent position is used as a starting simplex</li>
* <li>OptimizationType.PSO: each point and the position of the agent is used as a starting position of a particle</li>
* <li>OptimizationType.DISCRETE: each point is and the position of the agent is used to directly evaluate the evaluation function</li>
* </ul>
*/
private
int
stepCircleResolution
=
4
;
/**
* <p>
* Parameter of the optimization method: the number of circles. Together with the {@link AttributesOSM#stepCircleResolution}
* this gives the number of points used by the optimization solver.
* </p>
*/
private
int
numberOfCircles
=
1
;
/**
* <p>
* Parameter of the optimization method: Specifies the concrete optimization solver.
* </p>
*/
private
OptimizationType
optimizationType
=
OptimizationType
.
NELDER_MEAD
;
private
boolean
varyStepDirection
=
true
;
/**
* Used to compute the desired step length which is
* {@link AttributesOSM#stepLengthIntercept} + {@link AttributesOSM#stepLengthSlopeSpeed} * speed.
* (see seitz-2016 page 71 or seitz-2012).
*/
private
double
stepLengthIntercept
=
0.4625
;
/**
* Used to compute the desired step length which is
* {@link AttributesOSM#stepLengthIntercept} + {@link AttributesOSM#stepLengthSlopeSpeed} * speed + error
* (see seitz-2016 page 71 or seitz-2012).
*/
private
double
stepLengthSlopeSpeed
=
0.2345
;
/**
* Used to compute the error term of the desired step length i.e. the standard deviation of the normal
* distribution which is the distribution of the error variable.
* (see seitz-2016 page 71 or seitz-2012).
*/
private
double
stepLengthSD
=
0.036
;
/**
* Only used if {@link OptimizationType} is equal DISCRETE. If the potential does not improve by this
* movementThreshold, the agent will not move.
*/
private
double
movementThreshold
=
0
;
private
double
minStepLength
=
0.4625
;
/**
* Only used if {@link AttributesOSM#minimumStepLength} is true. The agent will not move if the
* next improvement is less than {@link AttributesOSM#minStepLength} away from its current position.
* Furthermore, this will be ignored if an agent is on stairs.
*/
private
double
minStepLength
=
0.10
;
/**
* If true enables the use of {@link AttributesOSM#minStepLength}. This attribute could be removed.
*/
private
boolean
minimumStepLength
=
true
;
/**
* The maximum amount of time a foot step of an agent can take. If the foot step takes more time
* its duration is reduced to {@link AttributesOSM#maxStepDuration}.
*/
private
double
maxStepDuration
=
Double
.
MAX_VALUE
;
private
OptimizationType
optimizationType
=
OptimizationType
.
NELDER_MEAD
;
/**
* Only used if {@link OptimizationType} is equal DISCRETE. Reduces the disc of the optimization to
* a cone (see seitz-2016 page 76).
*/
private
MovementType
movementType
=
MovementType
.
ARBITRARY
;
private
boolean
dynamicStepLength
=
false
;
/**
* SpeedAdjuster will only be active if this is true. For example this has to be true if the group model is
* active.
*/
private
boolean
dynamicStepLength
=
true
;
/**
* Specifies which update schema is used. The OSM should use the event driven update schema
* (see seitz-2014b)
*/
private
UpdateType
updateType
=
UpdateType
.
EVENT_DRIVEN
;
/**
* If true this avoids agent jumping over small walls. However, this does not fix the problem that
* the target potential computation fails due to small obstacles. Since this is a quick fix and the
* test is very expensive the default should be false!
*/
private
boolean
seeSmallWalls
=
false
;
private
boolean
minimumStepLength
=
true
;
private
String
targetPotentialModel
=
"org.vadere.simulator.models.potential.fields.PotentialFieldTargetGrid"
;
private
String
pedestrianPotentialModel
=
"org.vadere.simulator.models.potential.PotentialFieldPedestrianCompactSoftshell"
;
private
String
obstaclePotentialModel
=
"org.vadere.simulator.models.potential.PotentialFieldObstacleCompactSoftshell"
;
...
...
Write
Preview
Supports
Markdown
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