Commit 4055e642 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier

At controller level, moved all psychology-related stuff to new package "psychology"

Also renamed state package "psychology.stimuli" to "psychology.perception".

Also renamed following classes:
- "EventCognition" to "StimulusProcessor"
- "SalientBehaviorCognition" to "SalientBehaviorProcessor"
- "EventController" to "StimulusController"

Watch out: Event output processors and also the existing scenario files
have not been migrated. Therefore, the unit tests fail at the moment!
parent afdf0f6a
......@@ -7,8 +7,8 @@ import org.jetbrains.annotations.NotNull;
import org.vadere.simulator.projects.io.ColumnNames;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.psychology.behavior.SalientBehavior;
import org.vadere.state.psychology.stimuli.types.Stimulus;
import org.vadere.state.psychology.stimuli.types.StimulusFactory;
import org.vadere.state.psychology.perception.types.Stimulus;
import org.vadere.state.psychology.perception.types.StimulusFactory;
import org.vadere.state.scenario.Agent;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.simulation.FootStep;
......
......@@ -15,8 +15,8 @@ import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.dataprocessing.DataProcessingJsonManager;
import org.vadere.simulator.projects.io.JsonConverter;
import org.vadere.state.attributes.ModelDefinition;
import org.vadere.state.psychology.stimuli.json.StimulusInfoStore;
import org.vadere.state.psychology.stimuli.presettings.StimulusPresettings;
import org.vadere.state.psychology.perception.json.StimulusInfoStore;
import org.vadere.state.psychology.perception.presettings.StimulusPresettings;
import org.vadere.state.scenario.Topography;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.util.config.VadereConfig;
......
package org.vadere.simulator.control;
import org.vadere.simulator.control.cognition.EventCognition;
import org.vadere.simulator.control.cognition.SalientBehaviorCognition;
import org.vadere.simulator.control.events.EventController;
import org.vadere.simulator.control.psychology.perception.StimulusProcessor;
import org.vadere.simulator.control.psychology.behavior.SalientBehaviorProcessor;
import org.vadere.simulator.control.psychology.perception.StimulusController;
import org.vadere.simulator.control.factory.SourceControllerFactory;
import org.vadere.simulator.models.DynamicElementFactory;
import org.vadere.simulator.models.MainModel;
......@@ -18,7 +18,7 @@ import org.vadere.simulator.projects.dataprocessing.ProcessorManager;
import org.vadere.simulator.utils.cache.ScenarioCache;
import org.vadere.state.attributes.AttributesSimulation;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.psychology.stimuli.types.Stimulus;
import org.vadere.state.psychology.perception.types.Stimulus;
import org.vadere.state.scenario.*;
import org.vadere.util.logging.Logger;
......@@ -78,13 +78,11 @@ public class Simulation {
private final ProcessorManager processorManager;
private final SourceControllerFactory sourceControllerFactory;
private SimulationResult simulationResult;
private final EventController eventController;
private final EventCognition eventCognition;
private final SalientBehaviorCognition salientBehaviorCognition;
private final StimulusController stimulusController;
private final StimulusProcessor stimulusProcessor;
private final SalientBehaviorProcessor salientBehaviorProcessor;
private final ScenarioCache scenarioCache;
private boolean addedTargetPedestrian = false;
public Simulation(MainModel mainModel, double startTimeInSec, final String name, ScenarioStore scenarioStore,
List<PassiveCallback> passiveCallbacks, Random random, ProcessorManager processorManager,
SimulationResult simulationResult, List<RemoteRunListener> remoteRunListeners,
......@@ -117,40 +115,17 @@ public class Simulation {
this.remoteRunListeners = remoteRunListeners;
this.singleStepMode = singleStepMode;
// "eventController" is final. Therefore, create object here and not in helper method.
this.eventController = new EventController(scenarioStore);
this.eventCognition = new EventCognition();
this.salientBehaviorCognition = new SalientBehaviorCognition(topography);
// "stimulusController" is final. Therefore, create object here and not in helper method.
this.stimulusController = new StimulusController(scenarioStore);
this.stimulusProcessor = new StimulusProcessor();
this.salientBehaviorProcessor = new SalientBehaviorProcessor(topography);
createControllers(topography, mainModel, random);
// ::start:: this code is to visualize the potential fields. It may be refactored later.
// this code is to visualize the potential fields. It may be refactored later.
if(attributesSimulation.isVisualizationEnabled()) {
IPotentialFieldTarget pft = null;
IPotentialField pt = null;
if(mainModel instanceof PotentialFieldModel) {
pft = ((PotentialFieldModel) mainModel).getPotentialFieldTarget();
} else if(mainModel instanceof BehaviouralHeuristicsModel) {
pft = ((BehaviouralHeuristicsModel) mainModel).getPotentialFieldTarget();
}
if(pft != null) {
pt = (pos, agent) -> {
if(agent instanceof PedestrianOSM) {
return ((PedestrianOSM)agent).getPotential(pos);
}
else {
return 0.0;
}
};
}
for (PassiveCallback pc : this.passiveCallbacks) {
pc.setPotentialFieldTarget(pft);
pc.setPotentialField(pt);
}
initPotentialFieldsForVisualization(mainModel);
}
// ::end::
for (PassiveCallback pc : this.passiveCallbacks) {
pc.setTopography(topography);
......@@ -184,6 +159,32 @@ public class Simulation {
}
}
private void initPotentialFieldsForVisualization(MainModel mainModel) {
IPotentialFieldTarget pft = null;
IPotentialField pt = null;
if(mainModel instanceof PotentialFieldModel) {
pft = ((PotentialFieldModel) mainModel).getPotentialFieldTarget();
} else if(mainModel instanceof BehaviouralHeuristicsModel) {
pft = ((BehaviouralHeuristicsModel) mainModel).getPotentialFieldTarget();
}
if(pft != null) {
pt = (pos, agent) -> {
if(agent instanceof PedestrianOSM) {
return ((PedestrianOSM)agent).getPotential(pos);
}
else {
return 0.0;
}
};
}
for (PassiveCallback pc : this.passiveCallbacks) {
pc.setPotentialFieldTarget(pft);
pc.setPotentialField(pt);
}
}
private void preLoop() {
if (topographyController == null) {
logger.error("No topography loaded.");
......@@ -354,7 +355,7 @@ public class Simulation {
}
private void updateCallbacks(double simTimeInSec) {
List<Stimulus> stimuli = eventController.getEventsForTime(simTimeInSec);
List<Stimulus> stimuli = stimulusController.getStimuliForTime(simTimeInSec);
// "TargetControllers" are populated in each simulation loop because
// pedestrians can be declared as targets in each simulation loop.
......@@ -386,10 +387,10 @@ public class Simulation {
Collection<Pedestrian> pedestrians = topography.getElements(Pedestrian.class);
eventCognition.prioritizeEventsForPedestrians(stimuli, pedestrians);
stimulusProcessor.prioritizeStimuliForPedestrians(stimuli, pedestrians);
if (attributesSimulation.isUsePsychologyLayer()) {
salientBehaviorCognition.setSalientBehaviorForPedestrians(pedestrians, simTimeInSec);
salientBehaviorProcessor.setSalientBehaviorForPedestrians(pedestrians, simTimeInSec);
}
for (Model m : models) {
......
package org.vadere.simulator.control.cognition;
package org.vadere.simulator.control.psychology.behavior;
import org.vadere.state.psychology.stimuli.types.Bang;
import org.vadere.simulator.control.psychology.perception.StimulusProcessor;
import org.vadere.state.psychology.perception.types.Bang;
import org.vadere.state.psychology.behavior.SalientBehavior;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Topography;
......@@ -9,19 +10,19 @@ import org.vadere.state.simulation.FootstepHistory;
import java.util.Collection;
/**
* The SalientBehaviorCognition class should provide logic to change the salient behavior of a pedestrian
* The SalientBehaviorProcessor class should provide logic to change the salient behavior of a pedestrian
* (e.g., change to cooperative behavior when no movement is possible for n steps).
*
* Watch out: The {@link EventCognition} should be finished before using methods in this class because, usually,
* Watch out: The {@link StimulusProcessor} should be finished before using methods in this class because, usually,
* first an event occurs and then pedestrians decide about their behavior. E.g., first a {@link Bang} occurs
* and then a pedestrian decides to follow a {@link SalientBehavior#COOPERATIVE} behavior.
*/
public class SalientBehaviorCognition {
public class SalientBehaviorProcessor {
/** The salient behavior depends also on the surrounding environment. */
private Topography topography;
public SalientBehaviorCognition(Topography topography) {
public SalientBehaviorProcessor(Topography topography) {
this.topography = topography;
}
......
package org.vadere.simulator.control.events;
package org.vadere.simulator.control.psychology.perception;
import org.vadere.simulator.projects.ScenarioStore;
import org.vadere.state.psychology.stimuli.json.StimulusInfo;
import org.vadere.state.psychology.stimuli.types.ElapsedTime;
import org.vadere.state.psychology.stimuli.types.Stimulus;
import org.vadere.state.psychology.stimuli.types.Timeframe;
import org.vadere.state.psychology.perception.json.StimulusInfo;
import org.vadere.state.psychology.perception.types.ElapsedTime;
import org.vadere.state.psychology.perception.types.Stimulus;
import org.vadere.state.psychology.perception.types.Timeframe;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* The EventController encapsulates logic to raise stimuli.
* The StimulusController encapsulates logic to inject stimuli
* into the simulation loop.
*
* The EventController uses the passed {@link ScenarioStore}
* The StimulusController uses the passed {@link ScenarioStore}
* to extract the possible stimuli from the scenario description.
*
* TODO: Clarify what should happen if "simTimeSteps" is too coarse
* and defined stimuli cannot be triggered correctly here.
* TODO: Clarify what shall happen if "simTimeSteps" is too coarse
* and defined stimuli cannot be triggered correctly here.
*/
public class EventController {
public class StimulusController {
// Variables
private ScenarioStore scenarioStore;
private List<StimulusInfo> oneTimeEvents;
private List<StimulusInfo> recurringEvents;
private List<StimulusInfo> oneTimeStimuli;
private List<StimulusInfo> recurringStimuli;
// Constructors
public EventController(ScenarioStore scenarioStore) {
public StimulusController(ScenarioStore scenarioStore) {
this.scenarioStore = scenarioStore;
oneTimeEvents = scenarioStore.getStimulusInfoStore().getStimulusInfos().stream()
.filter(eventInfo -> eventInfo.getTimeframe().isRepeat() == false)
oneTimeStimuli = scenarioStore.getStimulusInfoStore().getStimulusInfos().stream()
.filter(stimulusInfo -> stimulusInfo.getTimeframe().isRepeat() == false)
.collect(Collectors.toList());
recurringEvents = scenarioStore.getStimulusInfoStore().getStimulusInfos().stream()
.filter(eventInfo -> eventInfo.getTimeframe().isRepeat() == true)
recurringStimuli = scenarioStore.getStimulusInfoStore().getStimulusInfos().stream()
.filter(stimulusInfo -> stimulusInfo.getTimeframe().isRepeat() == true)
.collect(Collectors.toList());
oneTimeEvents.stream().forEach(eventInfo -> throwExceptionIfTimeframeIsInvalid(eventInfo.getTimeframe(), false));
recurringEvents.stream().forEach(eventInfo -> throwExceptionIfTimeframeIsInvalid(eventInfo.getTimeframe(), true));
oneTimeStimuli.stream().forEach(stimulusInfo -> throwExceptionIfTimeframeIsInvalid(stimulusInfo.getTimeframe(), false));
recurringStimuli.stream().forEach(stimulusInfo -> throwExceptionIfTimeframeIsInvalid(stimulusInfo.getTimeframe(), true));
}
// Getters
public ScenarioStore getScenarioStore() {
return scenarioStore;
}
public List<StimulusInfo> getOneTimeEvents() { return oneTimeEvents; }
public List<StimulusInfo> getRecurringEvents() { return recurringEvents; }
public List<StimulusInfo> getOneTimeStimuli() { return oneTimeStimuli; }
public List<StimulusInfo> getRecurringStimuli() { return recurringStimuli; }
// Setters
public void setScenarioStore(ScenarioStore scenarioStore) {
this.scenarioStore = scenarioStore;
}
public void setOneTimeEvents(List<StimulusInfo> oneTimeEvents) { this.oneTimeEvents = oneTimeEvents; }
public void setRecurringEvents(List<StimulusInfo> recurringEvents) { this.recurringEvents = recurringEvents; }
public void setOneTimeStimuli(List<StimulusInfo> oneTimeStimuli) { this.oneTimeStimuli = oneTimeStimuli; }
public void setRecurringStimuli(List<StimulusInfo> recurringStimuli) { this.recurringStimuli = recurringStimuli; }
// Methods
public List<Stimulus> getEventsForTime(double simulationTime) {
public List<Stimulus> getStimuliForTime(double simulationTime) {
List<Stimulus> stimuli = new ArrayList<>();
// Always, create an "ElapsedTime".
stimuli.add(new ElapsedTime(simulationTime));
List<Stimulus> activeOneTimeStimuli = getOneTimeEventsForSimulationTime(simulationTime);
List<Stimulus> activeRecurringStimuli = getRecurringEventsForSimulationTime(simulationTime);
List<Stimulus> activeOneTimeStimuli = getOneTimeStimuliForSimulationTime(simulationTime);
List<Stimulus> activeRecurringStimuli = getRecurringStimuliForSimulationTime(simulationTime);
// Set timestamp for each active event.
activeOneTimeStimuli.stream().forEach(event -> event.setTime(simulationTime));
activeRecurringStimuli.stream().forEach((event -> event.setTime(simulationTime)));
// Set timestamp for each active stimulus.
activeOneTimeStimuli.stream().forEach(stimulus -> stimulus.setTime(simulationTime));
activeRecurringStimuli.stream().forEach((stimulus -> stimulus.setTime(simulationTime)));
stimuli.addAll(activeOneTimeStimuli);
stimuli.addAll(activeRecurringStimuli);
......@@ -76,22 +77,22 @@ public class EventController {
return stimuli;
}
private List<Stimulus> getOneTimeEventsForSimulationTime(double simulationTime) {
private List<Stimulus> getOneTimeStimuliForSimulationTime(double simulationTime) {
List<Stimulus> activeStimuli = new ArrayList<>();
oneTimeEvents.stream()
.filter(eventInfo -> oneTimeTimeframeIsActiveAtSimulationTime(eventInfo.getTimeframe(), simulationTime))
.forEach(eventInfo -> activeStimuli.addAll(eventInfo.getStimuli()));
oneTimeStimuli.stream()
.filter(stimulusInfo -> oneTimeTimeframeIsActiveAtSimulationTime(stimulusInfo.getTimeframe(), simulationTime))
.forEach(stimulusInfo -> activeStimuli.addAll(stimulusInfo.getStimuli()));
return activeStimuli;
}
private List<Stimulus> getRecurringEventsForSimulationTime(double simulationTime) {
private List<Stimulus> getRecurringStimuliForSimulationTime(double simulationTime) {
List<Stimulus> activeStimuli = new ArrayList<>();
recurringEvents.stream()
.filter(eventInfo -> timeframeIsActiveAtSimulationTime(eventInfo.getTimeframe(), simulationTime))
.forEach(eventInfo -> activeStimuli.addAll(eventInfo.getStimuli()));
recurringStimuli.stream()
.filter(stimulusInfo -> timeframeIsActiveAtSimulationTime(stimulusInfo.getTimeframe(), simulationTime))
.forEach(stimulusInfo -> activeStimuli.addAll(stimulusInfo.getStimuli()));
return activeStimuli;
}
......@@ -104,9 +105,9 @@ public class EventController {
public static boolean oneTimeTimeframeIsActiveAtSimulationTime(Timeframe timeframe, double simulationTime) {
throwExceptionIfTimeframeIsInvalid(timeframe, false);
boolean eventIsActive = (simulationTime >= timeframe.getStartTime() && simulationTime <= timeframe.getEndTime());
boolean stimuliIsActive = (simulationTime >= timeframe.getStartTime() && simulationTime <= timeframe.getEndTime());
return eventIsActive;
return stimuliIsActive;
}
/**
......@@ -142,19 +143,19 @@ public class EventController {
public static boolean timeframeIsActiveAtSimulationTime(Timeframe timeframe, double simulationTime) {
throwExceptionIfTimeframeIsInvalid(timeframe, true);
double eventLength = timeframe.getEndTime() - timeframe.getStartTime();
double eventPeriodLength = eventLength + timeframe.getWaitTimeBetweenRepetition();
double stimulusLength = timeframe.getEndTime() - timeframe.getStartTime();
double stimulusPeriodLength = stimulusLength + timeframe.getWaitTimeBetweenRepetition();
double normalizedSimulationTime = Math.max(0, (simulationTime - timeframe.getStartTime()));
// Check with unit testing if cut-off is okay here or if we need rounding.
int currentPeriod = (int)(normalizedSimulationTime / eventPeriodLength);
int currentPeriod = (int)(normalizedSimulationTime / stimulusPeriodLength);
double eventStartTimeCurrentPeriod = timeframe.getStartTime() + (currentPeriod * eventPeriodLength);
double eventEndTimeCurrentPeriod = eventStartTimeCurrentPeriod + eventLength;
double stimulusStartTimeCurrentPeriod = timeframe.getStartTime() + (currentPeriod * stimulusPeriodLength);
double stimulusEndTimeCurrentPeriod = stimulusStartTimeCurrentPeriod + stimulusLength;
boolean eventIsActive = (simulationTime >= eventStartTimeCurrentPeriod && simulationTime <= eventEndTimeCurrentPeriod);
boolean stimulusIsActive = (simulationTime >= stimulusStartTimeCurrentPeriod && simulationTime <= stimulusEndTimeCurrentPeriod);
return eventIsActive;
return stimulusIsActive;
}
/**
......
package org.vadere.simulator.control.cognition;
package org.vadere.simulator.control.psychology.perception;
import org.vadere.state.psychology.stimuli.types.*;
import org.vadere.state.psychology.perception.types.*;
import org.vadere.state.scenario.Pedestrian;
import java.util.Collection;
......@@ -8,12 +8,13 @@ import java.util.List;
import java.util.stream.Collectors;
/**
* The EventCognition class should provide logic to prioritize {@link Stimulus}s for a pedestrian based on its
* current state/attributes (e.g., a {@link Bang} is more important than a {@link Wait}.
* The StimulusProcessor class should provide logic to prioritize {@link Stimulus}
* for a pedestrian based on its current state/attributes (e.g., a {@link Bang}
* is more important than a {@link Wait}.
*/
public class EventCognition {
public class StimulusProcessor {
public void prioritizeEventsForPedestrians(List<Stimulus> stimuli, Collection<Pedestrian> pedestrians){
public void prioritizeStimuliForPedestrians(List<Stimulus> stimuli, Collection<Pedestrian> pedestrians){
for (Pedestrian pedestrian : pedestrians) {
// TODO: prioritize the stimuli for the current time step for each pedestrian individually.
// by using a finite state machine, weight pedestrian's attributes or any other good mechanism.
......@@ -25,14 +26,14 @@ public class EventCognition {
private Stimulus rankWaitHigherThanElapsedTime(List<Stimulus> stimuli, Pedestrian pedestrian) {
// TODO: replace dummy implementation here.
Stimulus mostImportantStimulus = stimuli.stream()
.filter(event -> event instanceof ElapsedTime)
.filter(stimulus -> stimulus instanceof ElapsedTime)
.collect(Collectors.toList())
.get(0);
List<Stimulus> waitStimuli = stimuli.stream().filter(event -> event instanceof Wait).collect(Collectors.toList());
List<Stimulus> waitInAreaStimuli = stimuli.stream().filter(event -> event instanceof WaitInArea).collect(Collectors.toList());
List<Stimulus> bangStimuli = stimuli.stream().filter(event -> event instanceof Bang).collect(Collectors.toList());
List<Stimulus> changeTargetStimuli = stimuli.stream().filter(event -> event instanceof ChangeTarget).collect(Collectors.toList());
List<Stimulus> waitStimuli = stimuli.stream().filter(stimulus -> stimulus instanceof Wait).collect(Collectors.toList());
List<Stimulus> waitInAreaStimuli = stimuli.stream().filter(stimulus -> stimulus instanceof WaitInArea).collect(Collectors.toList());
List<Stimulus> bangStimuli = stimuli.stream().filter(stimulus -> stimulus instanceof Bang).collect(Collectors.toList());
List<Stimulus> changeTargetStimuli = stimuli.stream().filter(stimulus -> stimulus instanceof ChangeTarget).collect(Collectors.toList());
if (changeTargetStimuli.size() >= 1) {
mostImportantStimulus = changeTargetStimuli.get(0);
......
......@@ -11,11 +11,11 @@ import org.jetbrains.annotations.Nullable;
import org.vadere.simulator.models.potential.fields.IPotentialFieldTarget;
import org.vadere.state.attributes.models.AttributesBHM;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.psychology.stimuli.exceptions.UnsupportedStimulusException;
import org.vadere.state.psychology.stimuli.types.ElapsedTime;
import org.vadere.state.psychology.stimuli.types.Stimulus;
import org.vadere.state.psychology.stimuli.types.Wait;
import org.vadere.state.psychology.stimuli.types.WaitInArea;
import org.vadere.state.psychology.perception.exceptions.UnsupportedStimulusException;
import org.vadere.state.psychology.perception.types.ElapsedTime;
import org.vadere.state.psychology.perception.types.Stimulus;
import org.vadere.state.psychology.perception.types.Wait;
import org.vadere.state.psychology.perception.types.WaitInArea;
import org.vadere.state.scenario.Obstacle;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Target;
......
......@@ -8,7 +8,7 @@ import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesBHM;
import org.vadere.state.attributes.models.AttributesBMM;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.psychology.stimuli.exceptions.UnsupportedStimulusException;
import org.vadere.state.psychology.perception.exceptions.UnsupportedStimulusException;
import org.vadere.state.scenario.DynamicElement;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Topography;
......
......@@ -14,7 +14,7 @@ import org.vadere.simulator.models.potential.fields.IPotentialFieldTarget;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesGNM;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.psychology.stimuli.exceptions.UnsupportedStimulusException;
import org.vadere.state.psychology.perception.exceptions.UnsupportedStimulusException;
import org.vadere.state.scenario.DynamicElement;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Target;
......
......@@ -6,9 +6,9 @@ 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.behavior.SalientBehavior;
import org.vadere.state.psychology.stimuli.types.Bang;
import org.vadere.state.psychology.stimuli.types.ChangeTarget;
import org.vadere.state.psychology.stimuli.types.Stimulus;
import org.vadere.state.psychology.perception.types.Bang;
import org.vadere.state.psychology.perception.types.ChangeTarget;
import org.vadere.state.psychology.perception.types.Stimulus;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Target;
import org.vadere.state.scenario.Topography;
......
......@@ -4,7 +4,7 @@ import org.jetbrains.annotations.NotNull;
import org.vadere.simulator.models.osm.OSMBehaviorController;
import org.vadere.simulator.models.osm.PedestrianOSM;
import org.vadere.state.psychology.behavior.SalientBehavior;
import org.vadere.state.psychology.stimuli.types.*;
import org.vadere.state.psychology.perception.types.*;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Topography;
......
......@@ -4,7 +4,7 @@ import org.jetbrains.annotations.NotNull;
import org.vadere.simulator.models.osm.OSMBehaviorController;
import org.vadere.simulator.models.osm.PedestrianOSM;
import org.vadere.state.psychology.behavior.SalientBehavior;
import org.vadere.state.psychology.stimuli.types.*;
import org.vadere.state.psychology.perception.types.*;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Topography;
......
......@@ -13,7 +13,7 @@ import org.vadere.simulator.models.reynolds.behaviour.Wander;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesReynolds;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.psychology.stimuli.exceptions.UnsupportedStimulusException;
import org.vadere.state.psychology.perception.exceptions.UnsupportedStimulusException;
import org.vadere.state.scenario.DynamicElement;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Topography;
......
......@@ -12,7 +12,7 @@ import org.vadere.simulator.models.potential.fields.PotentialFieldObstacle;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.models.AttributesSFM;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.psychology.stimuli.exceptions.UnsupportedStimulusException;
import org.vadere.state.psychology.perception.exceptions.UnsupportedStimulusException;
import org.vadere.state.scenario.DynamicElement;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Target;
......
......@@ -7,7 +7,7 @@ import org.vadere.simulator.projects.io.JsonConverter;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.AttributesSimulation;
import org.vadere.state.attributes.scenario.AttributesCar;
import org.vadere.state.psychology.stimuli.json.StimulusInfoStore;
import org.vadere.state.psychology.perception.json.StimulusInfoStore;
import org.vadere.state.scenario.Topography;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.util.data.FindByClass;
......
......@@ -10,7 +10,7 @@ import org.vadere.simulator.projects.dataprocessing.DataProcessingJsonManager;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.AttributesSimulation;
import org.vadere.state.attributes.ModelDefinition;
import org.vadere.state.psychology.stimuli.json.StimulusInfoStore;
import org.vadere.state.psychology.perception.json.StimulusInfoStore;
import org.vadere.state.scenario.Topography;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.util.reflection.DynamicClassInstantiator;
......
package org.vadere.state.psychology.stimuli.exceptions;
package org.vadere.state.psychology.perception.exceptions;
import org.jetbrains.annotations.NotNull;
import org.vadere.state.psychology.stimuli.types.ElapsedTime;
import org.vadere.state.psychology.stimuli.types.Stimulus;
import org.vadere.state.psychology.perception.types.ElapsedTime;
import org.vadere.state.psychology.perception.types.Stimulus;
import org.vadere.state.scenario.Pedestrian;
import java.util.Collection;
......
package org.vadere.state.psychology.stimuli.json;
package org.vadere.state.psychology.perception.json;
import org.vadere.state.psychology.stimuli.types.Stimulus;
import org.vadere.state.psychology.stimuli.types.Timeframe;
import org.vadere.state.psychology.perception.types.Stimulus;
import org.vadere.state.psychology.perception.types.Timeframe;
import java.util.List;
......
package org.vadere.state.psychology.stimuli.json;
package org.vadere.state.psychology.perception.json;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.vadere.state.psychology.stimuli.types.*;
import org.vadere.state.psychology.perception.types.*;
import org.vadere.state.util.JacksonObjectMapper;
import org.vadere.util.geometry.shapes.VRectangle;
......
package org.vadere.state.psychology.stimuli.presettings;
package org.vadere.state.psychology.perception.presettings;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.vadere.state.psychology.stimuli.json.StimulusInfo;
import org.vadere.state.psychology.stimuli.json.StimulusInfoStore;
import org.vadere.state.psychology.stimuli.types.*;
import org.vadere.state.psychology.perception.json.StimulusInfo;
import org.vadere.state.psychology.perception.json.StimulusInfoStore;
import org.vadere.state.psychology.perception.types.*;
import org.vadere.state.util.JacksonObjectMapper;
import org.vadere.util.geometry.shapes.VRectangle;
......
package org.vadere.state.psychology.stimuli.types;
import org.vadere.state.scenario.ScenarioElement;
import java.util.List;
package org.vadere.state.psychology.perception.types;
/**
* Class signals agents a bang - for instance something exploded.
......
package org.vadere.state.psychology.stimuli.types;
import org.vadere.state.scenario.ScenarioElement;
package org.vadere.state.psychology.perception.types;
import java.util.LinkedList;
import java.util.List;
/**
* Class signals agents to change their targets.
......
package org.vadere.state.psychology.stimuli.types;
import org.vadere.state.scenario.ScenarioElement;
import java.util.List;
package org.vadere.state.psychology.perception.types;
/**
* Class representing an elapsed time step.
......
package org.vadere.state.psychology.stimuli.types;
package org.vadere.state.psychology.perception.types;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonSubTypes;
......
package org.vadere.state.psychology.stimuli.types;
package org.vadere.state.psychology.perception.types;
import org.jetbrains.annotations.NotNull;
......
package org.vadere.state.psychology.stimuli.types;
package org.vadere.state.psychology.perception.types;
/**
* A timeframe in which one ore more stimuli can occur.
......
package org.vadere.state.psychology.stimuli.types;
import org.vadere.state.scenario.ScenarioElement;
import java.util.List;
package org.vadere.state.psychology.perception.types;
/**
* Class can signal agents to wait - for instance at a red traffic light.
......
package org.vadere.state.psychology.stimuli.types;
package org.vadere.state.psychology.perception.types;
import org.vadere.state.scenario.ScenarioElement;