Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
V
vadere
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
110
Issues
110
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
3
Merge Requests
3
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vadere
vadere
Commits
197b5cf9
Commit
197b5cf9
authored
Nov 01, 2019
by
Benedikt Kleinmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed enum "SocialCategory" to "SelfCategory" and renamed all dependent codeselfCategoryEnumName
parent
a53f0162
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
72 additions
and
68 deletions
+72
-68
VadereGui/src/org/vadere/gui/postvisualization/model/PostvisualizationModel.java
...e/gui/postvisualization/model/PostvisualizationModel.java
+4
-5
VadereGui/src/org/vadere/gui/postvisualization/model/TableTrajectoryFootStep.java
.../gui/postvisualization/model/TableTrajectoryFootStep.java
+7
-7
VadereSimulator/src/org/vadere/simulator/control/Simulation.java
...imulator/src/org/vadere/simulator/control/Simulation.java
+4
-4
VadereSimulator/src/org/vadere/simulator/control/psychology/cognition/SelfCategoryProcessor.java
...r/control/psychology/cognition/SelfCategoryProcessor.java
+11
-11
VadereSimulator/src/org/vadere/simulator/models/osm/OSMBehaviorController.java
...rg/vadere/simulator/models/osm/OSMBehaviorController.java
+2
-2
VadereSimulator/src/org/vadere/simulator/models/osm/updateScheme/UpdateSchemeEventDriven.java
...ator/models/osm/updateScheme/UpdateSchemeEventDriven.java
+3
-3
VadereSimulator/src/org/vadere/simulator/models/osm/updateScheme/UpdateSchemeSequential.java
...lator/models/osm/updateScheme/UpdateSchemeSequential.java
+3
-3
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/processor/FootStepSelfCategoryProcessor.java
...taprocessing/processor/FootStepSelfCategoryProcessor.java
+6
-6
VadereSimulator/src/org/vadere/simulator/projects/io/ColumnNames.java
...tor/src/org/vadere/simulator/projects/io/ColumnNames.java
+6
-6
VadereSimulator/src/org/vadere/simulator/projects/migration/jsontranformation/json/TargetVersionV1_5.java
...s/migration/jsontranformation/json/TargetVersionV1_5.java
+3
-3
VadereState/src/org/vadere/state/psychology/cognition/SelfCategory.java
...c/org/vadere/state/psychology/cognition/SelfCategory.java
+17
-0
VadereState/src/org/vadere/state/psychology/cognition/SocialCategory.java
...org/vadere/state/psychology/cognition/SocialCategory.java
+0
-12
VadereState/src/org/vadere/state/scenario/Pedestrian.java
VadereState/src/org/vadere/state/scenario/Pedestrian.java
+6
-6
No files found.
VadereGui/src/org/vadere/gui/postvisualization/model/PostvisualizationModel.java
View file @
197b5cf9
...
...
@@ -7,8 +7,7 @@ import org.vadere.gui.postvisualization.utils.PotentialFieldContainer;
import
org.vadere.simulator.projects.Scenario
;
import
org.vadere.state.attributes.AttributesSimulation
;
import
org.vadere.state.attributes.scenario.AttributesAgent
;
import
org.vadere.state.psychology.cognition.SocialCategory
;
import
org.vadere.state.psychology.perception.types.Stimulus
;
import
org.vadere.state.psychology.cognition.SelfCategory
;
import
org.vadere.state.psychology.perception.types.StimulusFactory
;
import
org.vadere.state.scenario.Agent
;
import
org.vadere.state.scenario.Pedestrian
;
...
...
@@ -232,9 +231,9 @@ public class PostvisualizationModel extends SimulationModel<PostvisualizationCon
pedestrian
.
setMostImportantStimulus
(
StimulusFactory
.
stringToStimulus
(
mostImportantStimulusString
));
}
if
(
trajectories
.
s
ocial
CategoryCol
!=
-
1
)
{
String
s
ocialCategoryString
=
row
.
getString
(
trajectories
.
social
CategoryCol
);
pedestrian
.
setS
ocialCategory
(
SocialCategory
.
valueOf
(
social
CategoryString
));
if
(
trajectories
.
s
elf
CategoryCol
!=
-
1
)
{
String
s
elfCategoryString
=
row
.
getString
(
trajectories
.
self
CategoryCol
);
pedestrian
.
setS
elfCategory
(
SelfCategory
.
valueOf
(
self
CategoryString
));
}
return
pedestrian
;
...
...
VadereGui/src/org/vadere/gui/postvisualization/model/TableTrajectoryFootStep.java
View file @
197b5cf9
...
...
@@ -6,7 +6,7 @@ import it.unimi.dsi.fastutil.ints.Int2IntMap;
import
org.jetbrains.annotations.NotNull
;
import
org.vadere.simulator.projects.io.ColumnNames
;
import
org.vadere.state.attributes.scenario.AttributesAgent
;
import
org.vadere.state.psychology.cognition.S
ocial
Category
;
import
org.vadere.state.psychology.cognition.S
elf
Category
;
import
org.vadere.state.psychology.perception.types.Stimulus
;
import
org.vadere.state.psychology.perception.types.StimulusFactory
;
import
org.vadere.state.scenario.Agent
;
...
...
@@ -55,7 +55,7 @@ public class TableTrajectoryFootStep {
public
final
int
groupSizeCol
;
public
final
int
mostImportantStimulusCol
;
public
final
int
s
ocial
CategoryCol
;
public
final
int
s
elf
CategoryCol
;
public
static
final
int
agentDFPedIdCol
=
0
;
public
static
final
int
birthTimeCol
=
1
;
...
...
@@ -85,7 +85,7 @@ public class TableTrajectoryFootStep {
groupIdCol
=
columnNames
.
getGroupIdCol
(
dataFrame
);
groupSizeCol
=
columnNames
.
getGroupSizeCol
(
dataFrame
);
mostImportantStimulusCol
=
columnNames
.
getMostImportantStimulusCol
(
dataFrame
);
s
ocialCategoryCol
=
columnNames
.
getSocial
CategoryCol
(
dataFrame
);
s
elfCategoryCol
=
columnNames
.
getSelf
CategoryCol
(
dataFrame
);
this
.
trajectoryDataFrame
=
dataFrame
;
...
...
@@ -143,10 +143,10 @@ public class TableTrajectoryFootStep {
pedestrian
.
setMostImportantStimulus
(
stimulus
);
}
if
(
s
ocial
CategoryCol
!=
ColumnNames
.
NOT_SET_COLUMN_INDEX_IDENTIFIER
)
{
String
s
ocialCategoryEnumName
=
row
.
getString
(
social
CategoryCol
);
S
ocialCategory
socialCategory
=
SocialCategory
.
valueOf
(
social
CategoryEnumName
);
pedestrian
.
setS
ocialCategory
(
social
Category
);
if
(
s
elf
CategoryCol
!=
ColumnNames
.
NOT_SET_COLUMN_INDEX_IDENTIFIER
)
{
String
s
elfCategoryEnumName
=
row
.
getString
(
self
CategoryCol
);
S
elfCategory
selfCategory
=
SelfCategory
.
valueOf
(
self
CategoryEnumName
);
pedestrian
.
setS
elfCategory
(
self
Category
);
}
return
pedestrian
;
...
...
VadereSimulator/src/org/vadere/simulator/control/Simulation.java
View file @
197b5cf9
package
org.vadere.simulator.control
;
import
org.vadere.simulator.control.psychology.cognition.SelfCategoryProcessor
;
import
org.vadere.simulator.control.psychology.perception.StimulusProcessor
;
import
org.vadere.simulator.control.psychology.cognition.SocialCategoryProcessor
;
import
org.vadere.simulator.control.psychology.perception.StimulusController
;
import
org.vadere.simulator.control.factory.SourceControllerFactory
;
import
org.vadere.simulator.models.DynamicElementFactory
;
...
...
@@ -80,7 +80,7 @@ public class Simulation {
private
SimulationResult
simulationResult
;
private
final
StimulusController
stimulusController
;
private
final
StimulusProcessor
stimulusProcessor
;
private
final
S
ocialCategoryProcessor
social
CategoryProcessor
;
private
final
S
elfCategoryProcessor
self
CategoryProcessor
;
private
final
ScenarioCache
scenarioCache
;
public
Simulation
(
MainModel
mainModel
,
double
startTimeInSec
,
final
String
name
,
ScenarioStore
scenarioStore
,
...
...
@@ -118,7 +118,7 @@ public class Simulation {
// "stimulusController" is final. Therefore, create object here and not in helper method.
this
.
stimulusController
=
new
StimulusController
(
scenarioStore
);
this
.
stimulusProcessor
=
new
StimulusProcessor
();
this
.
s
ocialCategoryProcessor
=
new
Social
CategoryProcessor
(
topography
);
this
.
s
elfCategoryProcessor
=
new
Self
CategoryProcessor
(
topography
);
createControllers
(
topography
,
mainModel
,
random
);
...
...
@@ -390,7 +390,7 @@ public class Simulation {
stimulusProcessor
.
prioritizeStimuliForPedestrians
(
stimuli
,
pedestrians
);
if
(
attributesSimulation
.
isUsePsychologyLayer
())
{
s
ocialCategoryProcessor
.
setSocial
CategoryOfPedestrian
(
pedestrians
,
simTimeInSec
);
s
elfCategoryProcessor
.
setSelf
CategoryOfPedestrian
(
pedestrians
,
simTimeInSec
);
}
for
(
Model
m
:
models
)
{
...
...
VadereSimulator/src/org/vadere/simulator/control/psychology/cognition/S
ocial
CategoryProcessor.java
→
VadereSimulator/src/org/vadere/simulator/control/psychology/cognition/S
elf
CategoryProcessor.java
View file @
197b5cf9
package
org.vadere.simulator.control.psychology.cognition
;
import
org.vadere.simulator.control.psychology.perception.StimulusProcessor
;
import
org.vadere.state.psychology.cognition.S
ocial
Category
;
import
org.vadere.state.psychology.cognition.S
elf
Category
;
import
org.vadere.state.psychology.perception.types.Bang
;
import
org.vadere.state.scenario.Pedestrian
;
import
org.vadere.state.scenario.Topography
;
...
...
@@ -10,26 +10,26 @@ import org.vadere.state.simulation.FootstepHistory;
import
java.util.Collection
;
/**
* The S
ocialCategoryProcessor class should provide logic to change the social
* category of a pedestrian (
e.g., change to cooperative if no movement is
*
possible for n steps)
.
* The S
elfCategoryProcessor class should provide logic to change the self
* category of a pedestrian (
see "reicher-2010"). E.g., change to cooperative
*
if no movement is possible for n steps
.
*
* Watch out: The {@link StimulusProcessor} should be finished before using
* methods in this class because, usually, first a stimulus is processed and
* then pedestrians decide which behavior to follow. E.g., first a {@link Bang}
* occurs and then a pedestrian decides to follow a {@link S
ocial
Category#TARGET_ORIENTED}
* occurs and then a pedestrian decides to follow a {@link S
elf
Category#TARGET_ORIENTED}
* behavior.
*/
public
class
S
ocial
CategoryProcessor
{
public
class
S
elf
CategoryProcessor
{
/** The s
ocial
category may also depend on the surrounding environment. */
/** The s
elf
category may also depend on the surrounding environment. */
private
Topography
topography
;
public
S
ocial
CategoryProcessor
(
Topography
topography
)
{
public
S
elf
CategoryProcessor
(
Topography
topography
)
{
this
.
topography
=
topography
;
}
public
void
setS
ocial
CategoryOfPedestrian
(
Collection
<
Pedestrian
>
pedestrians
,
double
simTimeInSec
)
{
public
void
setS
elf
CategoryOfPedestrian
(
Collection
<
Pedestrian
>
pedestrians
,
double
simTimeInSec
)
{
// TODO: Include more (pedestrian) attributes into decision process.
for
(
Pedestrian
pedestrian
:
pedestrians
)
{
...
...
@@ -42,11 +42,11 @@ public class SocialCategoryProcessor {
// Adapt category only if we have seen some footsteps in the past
if
(
footstepHistory
.
size
()
>=
requiredFootSteps
)
{
if
(
footstepHistory
.
getAverageSpeedInMeterPerSecond
()
<=
requiredSpeedInMetersPerSecondToBeCooperative
)
{
pedestrian
.
setS
ocialCategory
(
Social
Category
.
COOPERATIVE
);
pedestrian
.
setS
elfCategory
(
Self
Category
.
COOPERATIVE
);
}
else
{
// TODO: Maybe, check if area directed to target is free for a step
// (only then change to "TARGET_ORIENTED").
pedestrian
.
setS
ocialCategory
(
Social
Category
.
TARGET_ORIENTED
);
pedestrian
.
setS
elfCategory
(
Self
Category
.
TARGET_ORIENTED
);
}
}
}
...
...
VadereSimulator/src/org/vadere/simulator/models/osm/OSMBehaviorController.java
View file @
197b5cf9
...
...
@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull;
import
org.jetbrains.annotations.Nullable
;
import
org.vadere.simulator.models.potential.combinedPotentials.CombinedPotentialStrategy
;
import
org.vadere.state.attributes.scenario.AttributesAgent
;
import
org.vadere.state.psychology.cognition.S
ocial
Category
;
import
org.vadere.state.psychology.cognition.S
elf
Category
;
import
org.vadere.state.psychology.perception.types.Bang
;
import
org.vadere.state.psychology.perception.types.ChangeTarget
;
import
org.vadere.state.psychology.perception.types.Stimulus
;
...
...
@@ -133,7 +133,7 @@ public class OSMBehaviorController {
if
(
closestPedestrians
.
size
()
>
0
)
{
for
(
Pedestrian
closestPedestrian
:
closestPedestrians
)
{
if
(
pedestrian
.
hasNextTarget
())
{
boolean
closestPedIsCooperative
=
closestPedestrian
.
getS
ocialCategory
()
==
Social
Category
.
COOPERATIVE
;
boolean
closestPedIsCooperative
=
closestPedestrian
.
getS
elfCategory
()
==
Self
Category
.
COOPERATIVE
;
boolean
targetOrientationDiffers
=
false
;
// TODO: Use "pedestrian.getTargetGradient()" instead of "calculateAngleBetweenTargets()".
...
...
VadereSimulator/src/org/vadere/simulator/models/osm/updateScheme/UpdateSchemeEventDriven.java
View file @
197b5cf9
...
...
@@ -3,7 +3,7 @@ package org.vadere.simulator.models.osm.updateScheme;
import
org.jetbrains.annotations.NotNull
;
import
org.vadere.simulator.models.osm.OSMBehaviorController
;
import
org.vadere.simulator.models.osm.PedestrianOSM
;
import
org.vadere.state.psychology.cognition.S
ocial
Category
;
import
org.vadere.state.psychology.cognition.S
elf
Category
;
import
org.vadere.state.psychology.perception.types.*
;
import
org.vadere.state.scenario.Pedestrian
;
import
org.vadere.state.scenario.Topography
;
...
...
@@ -54,12 +54,12 @@ public class UpdateSchemeEventDriven implements UpdateSchemeOSM {
if
(
mostImportantStimulus
instanceof
ElapsedTime
)
{
double
stepDuration
=
pedestrian
.
getDurationNextStep
();
if
(
pedestrian
.
getS
ocialCategory
()
==
Social
Category
.
TARGET_ORIENTED
)
{
if
(
pedestrian
.
getS
elfCategory
()
==
Self
Category
.
TARGET_ORIENTED
)
{
// this can cause problems if the pedestrian desired speed is 0 (see speed adjuster)
pedestrian
.
updateNextPosition
();
osmBehaviorController
.
makeStep
(
pedestrian
,
topography
,
stepDuration
);
pedestrian
.
setTimeOfNextStep
(
pedestrian
.
getTimeOfNextStep
()
+
stepDuration
);
}
else
if
(
pedestrian
.
getS
ocialCategory
()
==
Social
Category
.
COOPERATIVE
)
{
}
else
if
(
pedestrian
.
getS
elfCategory
()
==
Self
Category
.
COOPERATIVE
)
{
// this call will also invoke setTimeOfNextStep
PedestrianOSM
candidate
=
osmBehaviorController
.
findSwapCandidate
(
pedestrian
,
topography
);
//TODO: Benedikt Kleinmeier:
...
...
VadereSimulator/src/org/vadere/simulator/models/osm/updateScheme/UpdateSchemeSequential.java
View file @
197b5cf9
...
...
@@ -3,7 +3,7 @@ package org.vadere.simulator.models.osm.updateScheme;
import
org.jetbrains.annotations.NotNull
;
import
org.vadere.simulator.models.osm.OSMBehaviorController
;
import
org.vadere.simulator.models.osm.PedestrianOSM
;
import
org.vadere.state.psychology.cognition.S
ocial
Category
;
import
org.vadere.state.psychology.cognition.S
elf
Category
;
import
org.vadere.state.psychology.perception.types.*
;
import
org.vadere.state.scenario.Pedestrian
;
import
org.vadere.state.scenario.Topography
;
...
...
@@ -55,9 +55,9 @@ public class UpdateSchemeSequential implements UpdateSchemeOSM {
if
(
mostImportantStimulus
instanceof
ElapsedTime
)
{
pedestrian
.
setTimeCredit
(
pedestrian
.
getTimeCredit
()
+
timeStepInSec
);
pedestrian
.
clearStrides
();
if
(
pedestrian
.
getS
ocialCategory
()
==
Social
Category
.
TARGET_ORIENTED
)
{
if
(
pedestrian
.
getS
elfCategory
()
==
Self
Category
.
TARGET_ORIENTED
)
{
useTimeCredit
(
pedestrian
,
timeStepInSec
);
}
else
if
(
pedestrian
.
getS
ocialCategory
()
==
Social
Category
.
COOPERATIVE
)
{
}
else
if
(
pedestrian
.
getS
elfCategory
()
==
Self
Category
.
COOPERATIVE
)
{
PedestrianOSM
candidate
=
osmBehaviorController
.
findSwapCandidate
(
pedestrian
,
topography
);
if
(
candidate
!=
null
)
{
candidate
.
setTimeCredit
(
pedestrian
.
getTimeCredit
()
+
timeStepInSec
);
...
...
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/processor/FootStepS
ocial
CategoryProcessor.java
→
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/processor/FootStepS
elf
CategoryProcessor.java
View file @
197b5cf9
...
...
@@ -10,14 +10,14 @@ import org.vadere.state.simulation.VTrajectory;
import
java.util.Collection
;
/**
* Save s
ocial
category of a pedestrian in each time step in an own column.
* Save s
elf
category of a pedestrian in each time step in an own column.
*/
@DataProcessorClass
()
public
class
FootStepS
ocial
CategoryProcessor
extends
DataProcessor
<
EventtimePedestrianIdKey
,
String
>
{
public
class
FootStepS
elf
CategoryProcessor
extends
DataProcessor
<
EventtimePedestrianIdKey
,
String
>
{
public
static
String
HEADER
=
"s
ocial
Category"
;
public
static
String
HEADER
=
"s
elf
Category"
;
public
FootStepS
ocial
CategoryProcessor
()
{
public
FootStepS
elf
CategoryProcessor
()
{
super
(
HEADER
);
}
...
...
@@ -27,9 +27,9 @@ public class FootStepSocialCategoryProcessor extends DataProcessor<EventtimePede
for
(
Pedestrian
p
:
pedestrians
){
VTrajectory
traj
=
p
.
getTrajectory
();
String
s
laientBehavior
=
p
.
getSocial
Category
().
toString
();
String
s
elfCategoryString
=
p
.
getSelf
Category
().
toString
();
for
(
FootStep
fs
:
traj
.
getFootSteps
()){
this
.
putValue
(
new
EventtimePedestrianIdKey
(
fs
.
getStartTime
(),
p
.
getId
()),
s
laientBehavior
);
this
.
putValue
(
new
EventtimePedestrianIdKey
(
fs
.
getStartTime
(),
p
.
getId
()),
s
elfCategoryString
);
}
}
}
...
...
VadereSimulator/src/org/vadere/simulator/projects/io/ColumnNames.java
View file @
197b5cf9
...
...
@@ -21,7 +21,7 @@ public final class ColumnNames {
private
Set
<
String
>
startTimeKeys
;
private
Set
<
String
>
endTimeKeys
;
private
Set
<
String
>
mostImportantStimulusKeys
;
private
Set
<
String
>
s
ocial
CategoryKeys
;
private
Set
<
String
>
s
elf
CategoryKeys
;
private
List
<
Set
<
String
>>
keys
;
public
static
final
int
NOT_SET_COLUMN_INDEX_IDENTIFIER
=
-
1
;
...
...
@@ -46,7 +46,7 @@ public final class ColumnNames {
groupIdKeys
=
new
HashSet
<>();
groupSizeKeys
=
new
HashSet
<>();
mostImportantStimulusKeys
=
new
HashSet
<>();
s
ocial
CategoryKeys
=
new
HashSet
<>();
s
elf
CategoryKeys
=
new
HashSet
<>();
startTimeKeys
=
new
HashSet
<>();
endTimeKeys
=
new
HashSet
<>();
...
...
@@ -68,7 +68,7 @@ public final class ColumnNames {
groupIdKeys
.
add
(
"groupId"
);
groupSizeKeys
.
add
(
"groupSize"
);
mostImportantStimulusKeys
.
add
(
"mostImportantStimulus"
);
s
ocialCategoryKeys
.
add
(
"social
Category"
);
s
elfCategoryKeys
.
add
(
"self
Category"
);
keys
.
add
(
pedestrianIdKeys
);
keys
.
add
(
startX
);
...
...
@@ -79,13 +79,13 @@ public final class ColumnNames {
keys
.
add
(
groupIdKeys
);
keys
.
add
(
groupSizeKeys
);
keys
.
add
(
mostImportantStimulusKeys
);
keys
.
add
(
s
ocial
CategoryKeys
);
keys
.
add
(
s
elf
CategoryKeys
);
keys
.
add
(
startTimeKeys
);
keys
.
add
(
endTimeKeys
);
}
public
int
getS
ocial
CategoryCol
(
@NotNull
final
Table
dataFrame
)
{
return
getColId
(
dataFrame
,
s
ocial
CategoryKeys
);
public
int
getS
elf
CategoryCol
(
@NotNull
final
Table
dataFrame
)
{
return
getColId
(
dataFrame
,
s
elf
CategoryKeys
);
}
public
int
getMostImportantStimulusCol
(
@NotNull
final
Table
dataFrame
)
{
...
...
VadereSimulator/src/org/vadere/simulator/projects/migration/jsontranformation/json/TargetVersionV1_5.java
View file @
197b5cf9
...
...
@@ -44,7 +44,7 @@ import org.vadere.simulator.projects.migration.jsontranformation.SimpleJsonTrans
* Also, rename
* - "useSalientBehavior" to "usePsychologyLayer" under "attributesSimulation" node
* - "FootStepMostImportantEventProcessor" to "FootStepMostImportantStimulusProcessor"
* - "FootStepSalientBehaviorProcessor" to "FootStepS
ocial
CategoryProcessor"
* - "FootStepSalientBehaviorProcessor" to "FootStepS
elf
CategoryProcessor"
* - "salientBehavior" in "dynamicElements" node
*/
@MigrationTransformation
(
targetVersionLabel
=
"1.5"
)
...
...
@@ -182,7 +182,7 @@ public class TargetVersionV1_5 extends SimpleJsonTransformation {
private
void
renameOutputProcessorSalientBehavior
(
JsonNode
node
)
throws
MigrationException
{
String
oldName
=
"FootStepSalientBehaviorProcessor"
;
String
newName
=
"FootStepS
ocial
CategoryProcessor"
;
String
newName
=
"FootStepS
elf
CategoryProcessor"
;
renameOutputProcessor
(
node
,
oldName
,
newName
);
}
...
...
@@ -205,7 +205,7 @@ public class TargetVersionV1_5 extends SimpleJsonTransformation {
private
void
renameSalientBehaviorInDynamicElements
(
JsonNode
node
)
throws
MigrationException
{
String
oldName
=
"salientBehavior"
;
String
newName
=
"s
ocial
Category"
;
String
newName
=
"s
elf
Category"
;
JsonNode
dynamicElementsNode
=
path
(
node
,
"scenario/topography/dynamicElements"
);
...
...
VadereState/src/org/vadere/state/psychology/cognition/SelfCategory.java
0 → 100644
View file @
197b5cf9
package
org.vadere.state.psychology.cognition
;
/**
* According to the self-categorization theory ("reicher-2010"), people define
* themselves as member of a social category. Often, people act collectively
* when being in the same category. E.g., protesters - which define themselves
* as protesers - walk together during a demonstration.
*
* Our agents can use these categorizations to to derive a specific behavior.
* E.g., if an agents is "COOPERATIVE", the pedestrian swaps places
* with other "COOPERATIVE" pedestrians.
*
* Watch out: The self category of an agent can change during a simulation.
*/
public
enum
SelfCategory
{
TARGET_ORIENTED
,
COOPERATIVE
}
VadereState/src/org/vadere/state/psychology/cognition/SocialCategory.java
deleted
100644 → 0
View file @
a53f0162
package
org.vadere.state.psychology.cognition
;
/**
* A pedestrian uses these social categories to derive a specific behavior.
* E.g., if a pedestrian is "COOPERATIVE", the pedestrian swaps places
* with other "COOPERATIVE" pedestrians.
*
* Watch out: The social category of a pedestrian can change during a simulation.
*/
public
enum
SocialCategory
{
TARGET_ORIENTED
,
COOPERATIVE
}
VadereState/src/org/vadere/state/scenario/Pedestrian.java
View file @
197b5cf9
package
org.vadere.state.scenario
;
import
org.vadere.state.attributes.scenario.AttributesAgent
;
import
org.vadere.state.psychology.cognition.S
ocial
Category
;
import
org.vadere.state.psychology.cognition.S
elf
Category
;
import
org.vadere.state.psychology.perception.types.Stimulus
;
import
org.vadere.state.simulation.FootStep
;
import
org.vadere.state.simulation.FootstepHistory
;
...
...
@@ -25,7 +25,7 @@ public class Pedestrian extends Agent {
private
boolean
isChild
;
// TODO should actually be an attribute or a member of a subclass
private
boolean
isLikelyInjured
;
// TODO should actually be an attribute or a member of a subclass
private
Stimulus
mostImportantStimulus
;
/** Evaluated in each time step in "EventCognition". */
private
S
ocialCategory
social
Category
;
private
S
elfCategory
self
Category
;
private
LinkedList
<
Integer
>
groupIds
;
// TODO should actually be an attribute or a member of a subclass
/**
* trajectory is a list of foot steps a pedestrian made during the duration of one time step.
...
...
@@ -59,7 +59,7 @@ public class Pedestrian extends Agent {
isChild
=
false
;
isLikelyInjured
=
false
;
mostImportantStimulus
=
null
;
s
ocialCategory
=
Social
Category
.
TARGET_ORIENTED
;
s
elfCategory
=
Self
Category
.
TARGET_ORIENTED
;
groupIds
=
new
LinkedList
<>();
groupSizes
=
new
LinkedList
<>();
modelPedestrianMap
=
new
HashMap
<>();
...
...
@@ -74,7 +74,7 @@ public class Pedestrian extends Agent {
isChild
=
other
.
isChild
;
isLikelyInjured
=
other
.
isLikelyInjured
;
mostImportantStimulus
=
other
.
mostImportantStimulus
;
s
ocialCategory
=
other
.
social
Category
;
s
elfCategory
=
other
.
self
Category
;
if
(
other
.
groupIds
!=
null
)
{
groupIds
=
new
LinkedList
<>(
other
.
groupIds
);
...
...
@@ -100,7 +100,7 @@ public class Pedestrian extends Agent {
return
isLikelyInjured
;
}
public
Stimulus
getMostImportantStimulus
()
{
return
mostImportantStimulus
;
}
public
S
ocialCategory
getSocialCategory
()
{
return
social
Category
;
}
public
S
elfCategory
getSelfCategory
()
{
return
self
Category
;
}
public
LinkedList
<
Integer
>
getGroupIds
()
{
return
groupIds
;
}
public
LinkedList
<
Integer
>
getGroupSizes
()
{
return
groupSizes
;
...
...
@@ -148,7 +148,7 @@ public class Pedestrian extends Agent {
this
.
isLikelyInjured
=
likelyInjured
;
}
public
void
setMostImportantStimulus
(
Stimulus
mostImportantStimulus
)
{
this
.
mostImportantStimulus
=
mostImportantStimulus
;
}
public
void
setS
ocialCategory
(
SocialCategory
socialCategory
)
{
this
.
socialCategory
=
social
Category
;
}
public
void
setS
elfCategory
(
SelfCategory
selfCategory
)
{
this
.
selfCategory
=
self
Category
;
}
public
void
setGroupIds
(
LinkedList
<
Integer
>
groupIds
)
{
this
.
groupIds
=
groupIds
;
}
...
...
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