Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
3928a03f
Commit
3928a03f
authored
Apr 16, 2019
by
Benedikt Kleinmeier
Browse files
Added boolean flag "useSalientBehavior" to "AttributesSimulation" and use it in "Simulation".
parent
790cd246
Changes
6
Hide whitespace changes
Inline
Side-by-side
VadereModelTests/TestSalientBehavior/scenarios/01-ExperimentSetup-OSMEventDriven.scenario
View file @
3928a03f
...
...
@@ -98,7 +98,8 @@
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 6138355022448163583,
"simulationSeed" : 0
"simulationSeed" : 0,
"useSalientBehavior" : true
},
"topography" : {
"attributes" : {
...
...
VadereModelTests/TestSalientBehavior/scenarios/02-ExperimentSetup-OSMSequential.scenario
View file @
3928a03f
...
...
@@ -98,7 +98,8 @@
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 6138355022448163583,
"simulationSeed" : 0
"simulationSeed" : 0,
"useSalientBehavior" : true
},
"topography" : {
"attributes" : {
...
...
VadereModelTests/TestSalientBehavior/scenarios/03-UnidirectionalFlow-OSMSequential.scenario
View file @
3928a03f
...
...
@@ -98,7 +98,8 @@
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 6138355022448163583,
"simulationSeed" : 0
"simulationSeed" : 0,
"useSalientBehavior" : true
},
"topography" : {
"attributes" : {
...
...
VadereModelTests/TestSalientBehavior/scenarios/04-CounterFlow-OSMSequential.scenario
View file @
3928a03f
...
...
@@ -98,7 +98,8 @@
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 6138355022448163583,
"simulationSeed" : 6138355022448163583
"simulationSeed" : 6138355022448163583,
"useSalientBehavior" : true
},
"topography" : {
"attributes" : {
...
...
VadereSimulator/src/org/vadere/simulator/control/Simulation.java
View file @
3928a03f
...
...
@@ -322,7 +322,10 @@ public class Simulation {
Collection
<
Pedestrian
>
pedestrians
=
topography
.
getElements
(
Pedestrian
.
class
);
eventCognition
.
prioritizeEventsForPedestrians
(
events
,
pedestrians
);
salientBehaviorCognition
.
setSalientBehaviorForPedestrians
(
pedestrians
,
simTimeInSec
);
if
(
attributesSimulation
.
isUseSalientBehavior
())
{
salientBehaviorCognition
.
setSalientBehaviorForPedestrians
(
pedestrians
,
simTimeInSec
);
}
for
(
Model
m
:
models
)
{
List
<
SourceController
>
stillSpawningSource
=
this
.
sourceControllers
.
stream
().
filter
(
s
->
!
s
.
isSourceFinished
(
simTimeInSec
)).
collect
(
Collectors
.
toList
());
...
...
VadereState/src/org/vadere/state/attributes/AttributesSimulation.java
View file @
3928a03f
...
...
@@ -21,6 +21,8 @@ public class AttributesSimulation extends Attributes {
private
boolean
useFixedSeed
=
true
;
private
long
fixedSeed
=
new
Random
().
nextLong
();
private
long
simulationSeed
;
/** Allows agent to change their behavior (e.g. from TARGET_ORIENTIED to COOPERATIVE if it is too dense) */
private
boolean
useSalientBehavior
=
false
;
// Getter...
...
...
@@ -48,7 +50,6 @@ public class AttributesSimulation extends Attributes {
return
printFPS
;
}
public
int
getDigitsPerCoordinate
()
{
return
digitsPerCoordinate
;
}
...
...
@@ -65,6 +66,12 @@ public class AttributesSimulation extends Attributes {
return
simulationSeed
;
}
public
boolean
isUseSalientBehavior
()
{
return
useSalientBehavior
;
}
// Setters...
public
void
setFinishTime
(
double
finishTime
)
{
checkSealed
();
this
.
finishTime
=
finishTime
;
...
...
@@ -116,6 +123,10 @@ public class AttributesSimulation extends Attributes {
this
.
simulationSeed
=
simulationSeed
;
}
public
void
setUseSalientBehavior
(
boolean
useSalientBehavior
)
{
this
.
useSalientBehavior
=
useSalientBehavior
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
...
...
@@ -130,12 +141,12 @@ public class AttributesSimulation extends Attributes {
digitsPerCoordinate
==
that
.
digitsPerCoordinate
&&
useFixedSeed
==
that
.
useFixedSeed
&&
fixedSeed
==
that
.
fixedSeed
&&
simulationSeed
==
that
.
simulationSeed
;
simulationSeed
==
that
.
simulationSeed
&&
useSalientBehavior
==
that
.
useSalientBehavior
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
finishTime
,
simTimeStepLength
,
realTimeSimTimeRatio
,
writeSimulationData
,
visualizationEnabled
,
printFPS
,
digitsPerCoordinate
,
useFixedSeed
,
fixedSeed
,
simulationSeed
);
return
Objects
.
hash
(
finishTime
,
simTimeStepLength
,
realTimeSimTimeRatio
,
writeSimulationData
,
visualizationEnabled
,
printFPS
,
digitsPerCoordinate
,
useFixedSeed
,
fixedSeed
,
simulationSeed
,
useSalientBehavior
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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