Commit a3c9828f authored by Christina's avatar Christina
Browse files

add informationstate

parent 0158320b
Pipeline #593901 passed with stages
in 136 minutes and 17 seconds
......@@ -13,6 +13,7 @@ import org.vadere.manager.traci.commands.TraCIGetCommand;
import org.vadere.manager.traci.commands.TraCISetCommand;
import org.vadere.manager.traci.response.TraCIGetResponse;
import org.vadere.simulator.control.simulation.SimulationState;
import org.vadere.state.psychology.information.InformationState;
import org.vadere.state.psychology.perception.types.KnowledgeItem;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.traci.CompoundObject;
......@@ -419,6 +420,7 @@ public class PersonCommandHandler extends CommandHandler<PersonVar> {
if (checkIfPedestrianExists(ped, cmd)) {
KnowledgeItem s = new KnowledgeItem(start_t, obsolete_at, information);
ped.getKnowledgeBase().addInformation(s);
ped.getKnowledgeBase().setInformationState(InformationState.INFORMATION_RECEIVED);
cmd.setOK();
}
});
......
......@@ -5,6 +5,7 @@ import org.json.JSONObject;
import org.vadere.simulator.control.external.reaction.ReactionModel;
import org.vadere.simulator.control.psychology.perception.StimulusController;
import org.vadere.simulator.projects.ScenarioStore;
import org.vadere.state.psychology.information.InformationState;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.Topography;
import org.vadere.util.logging.Logger;
......@@ -156,6 +157,9 @@ public abstract class ControlModel implements IControlModel {
if (isPedReact()){
triggerRedRaction(ped);
}
else{
ped.getKnowledgeBase().setInformationState(InformationState.INFORMATION_UNCONVINCING_RECEIVED);
}
}
public boolean isInformationProcessed(Pedestrian ped, int commandId){
......
......@@ -6,6 +6,7 @@ import org.apache.commons.math3.random.RandomGenerator;
import org.json.JSONArray;
import org.json.JSONObject;
import org.vadere.simulator.control.external.reaction.ReactionModel;
import org.vadere.state.psychology.information.InformationState;
import org.vadere.state.psychology.perception.types.ChangeTarget;
import org.vadere.state.scenario.Pedestrian;
......@@ -61,6 +62,7 @@ public class RouteChoice extends ControlModel {
logger.debug("Pedestrian " + ped.getId() + ": created Stimulus ChangeTarget. New target list " + newTargetList);
}else{
ped.setTargets(newTargetList);
ped.getKnowledgeBase().setInformationState(InformationState.INFORMATION_CONVINCING_RECEIVED);
logger.debug("Pedestrian " + ped.getId() + ": changed target list from " + oldTarget + " to " + newTargetList);
}
......
......@@ -2,8 +2,10 @@ package org.vadere.state.psychology;
import org.vadere.state.psychology.cognition.GroupMembership;
import org.vadere.state.psychology.cognition.SelfCategory;
import org.vadere.state.psychology.information.InformationState;
import org.vadere.state.psychology.information.KnowledgeBase;
import org.vadere.state.psychology.perception.ThreatMemory;
import org.vadere.state.psychology.perception.types.ElapsedTime;
import org.vadere.state.psychology.perception.types.Stimulus;
public class PsychologyStatus {
......@@ -46,6 +48,9 @@ public class PsychologyStatus {
// Setter
public void setMostImportantStimulus(Stimulus mostImportantStimulus) {
this.mostImportantStimulus = mostImportantStimulus;
if (!(mostImportantStimulus instanceof ElapsedTime)){
this.getKnowledgeBase().setInformationState(InformationState.INFORMATION_STIMULUS);
}
}
public void setThreatMemory(ThreatMemory threatMemory) { this.threatMemory = threatMemory; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment