Commit 86471c0c authored by Christina's avatar Christina

add strategyModel

parent f5390f1d
Pipeline #297634 failed with stages
in 2 minutes and 27 seconds
{
"name" : "AbstractThreeCorridors",
"description" : "",
"release" : "1.13",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.EventtimePedestrianIdOutputFile",
"filename" : "postvis.traj",
"processors" : [ 1, 2 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOverlapOutputFile",
"filename" : "overlaps.csv",
"processors" : [ 3 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.NoDataKeyOutputFile",
"filename" : "overlapCount.txt",
"processors" : [ 4 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepOutputFile",
"filename" : "densities.csv",
"processors" : [ 5, 6, 7, 8 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.FootStepTargetIDProcessor",
"id" : 2
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianOverlapProcessor",
"id" : 3
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.NumberOverlapsProcessor",
"id" : 4,
"attributesType" : "org.vadere.state.attributes.processor.AttributesNumberOverlapsProcessor",
"attributes" : {
"pedestrianOverlapProcessorId" : 3
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaDensityCountingProcessor",
"id" : 5,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor",
"attributes" : {
"measurementAreaId" : 2001
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaDensityCountingProcessor",
"id" : 6,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor",
"attributes" : {
"measurementAreaId" : 2002
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaDensityCountingProcessor",
"id" : 7,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor",
"attributes" : {
"measurementAreaId" : 2003
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaDensityCountingProcessor",
"id" : 8,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor",
"attributes" : {
"measurementAreaId" : 1000
}
} ],
"isTimestamped" : false,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"strategyModel" : "org.vadere.simulator.models.strategy.navigation.RouteChoiceThreeCorridors",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" : 4,
"numberOfCircles" : 1,
"optimizationType" : "NELDER_MEAD",
"varyStepDirection" : true,
"movementType" : "ARBITRARY",
"stepLengthIntercept" : 0.4625,
"stepLengthSlopeSpeed" : 0.2345,
"stepLengthSD" : 0.036,
"movementThreshold" : 0.0,
"minStepLength" : 0.1,
"minimumStepLength" : true,
"maxStepDuration" : 1.7976931348623157E308,
"dynamicStepLength" : true,
"updateType" : "EVENT_DRIVEN",
"seeSmallWalls" : false,
"targetPotentialModel" : "org.vadere.simulator.models.potential.fields.PotentialFieldTargetGrid",
"pedestrianPotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldPedestrianCompactSoftshell",
"obstaclePotentialModel" : "org.vadere.simulator.models.potential.PotentialFieldObstacleCompactSoftshell",
"submodels" : [ ]
},
"org.vadere.state.attributes.models.AttributesPotentialCompactSoftshell" : {
"pedPotentialIntimateSpaceWidth" : 0.45,
"pedPotentialPersonalSpaceWidth" : 1.2,
"pedPotentialHeight" : 50.0,
"obstPotentialWidth" : 0.8,
"obstPotentialHeight" : 6.0,
"intimateSpaceFactor" : 1.2,
"personalSpacePower" : 1,
"intimateSpacePower" : 1
},
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"cacheType" : "NO_CACHE",
"cacheDir" : "",
"timeCostAttributes" : {
"standardDeviation" : 0.7,
"type" : "UNIT",
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
"pedestrianOtherTargetDensityWeight" : 3.5,
"pedestrianWeight" : 30.0,
"queueWidthLoading" : 1.0,
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT",
"width" : 0.2,
"height" : 1.0
}
}
},
"attributesSimulation" : {
"finishTime" : 250.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 2617225706430579811,
"simulationSeed" : 0
},
"attributesPsychology" : {
"usePsychologyLayer" : false,
"psychologyLayer" : {
"perception" : "SimplePerceptionModel",
"cognition" : "SimpleCognitionModel"
}
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 0.0,
"y" : 0.0,
"width" : 80.0,
"height" : 50.5
},
"boundingBoxWidth" : 0.5,
"bounded" : true,
"referenceCoordinateSystem" : null
},
"obstacles" : [ {
"shape" : {
"x" : 55.0,
"y" : 3.5,
"width" : 25.0,
"height" : 36.5,
"type" : "RECTANGLE"
},
"id" : 2
}, {
"shape" : {
"x" : 35.0,
"y" : 3.5,
"width" : 17.0,
"height" : 36.5,
"type" : "RECTANGLE"
},
"id" : 5
}, {
"shape" : {
"x" : 15.0,
"y" : 3.5,
"width" : 17.0,
"height" : 36.5,
"type" : "RECTANGLE"
},
"id" : 6
}, {
"shape" : {
"x" : 0.0,
"y" : 3.5,
"width" : 12.0,
"height" : 36.5,
"type" : "RECTANGLE"
},
"id" : 7
} ],
"measurementAreas" : [ {
"shape" : {
"x" : 60.0,
"y" : 40.0,
"width" : 10.0,
"height" : 10.0,
"type" : "RECTANGLE"
},
"id" : 1000
}, {
"shape" : {
"x" : 12.0,
"y" : 8.0,
"width" : 3.0,
"height" : 30.0,
"type" : "RECTANGLE"
},
"id" : 2001
}, {
"shape" : {
"x" : 32.0,
"y" : 8.0,
"width" : 3.0,
"height" : 30.0,
"type" : "RECTANGLE"
},
"id" : 2002
}, {
"shape" : {
"x" : 52.0,
"y" : 8.0,
"width" : 3.0,
"height" : 30.0,
"type" : "RECTANGLE"
},
"id" : 2003
}, {
"shape" : {
"x" : 55.5,
"y" : 0.5,
"width" : 17.0,
"height" : 3.0,
"type" : "RECTANGLE"
},
"id" : 1
} ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : 72.6,
"y" : 42.7,
"width" : 5.0,
"height" : 5.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
}, {
"id" : 2001,
"absorbing" : false,
"shape" : {
"x" : 12.0,
"y" : 6.0,
"width" : 3.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
}, {
"id" : 2003,
"absorbing" : false,
"shape" : {
"x" : 52.0,
"y" : 6.0,
"width" : 3.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
}, {
"id" : 2002,
"absorbing" : false,
"shape" : {
"x" : 32.0,
"y" : 6.0,
"width" : 3.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"targetChangers" : [ {
"id" : 4,
"shape" : {
"x" : 12.0,
"y" : 4.5,
"width" : 3.0,
"height" : 1.5,
"type" : "RECTANGLE"
},
"reachDistance" : 0.0,
"changeAlgorithmType" : "SELECT_LIST",
"nextTarget" : [ 1 ],
"probabilityToChangeTarget" : [ 1.0 ]
}, {
"id" : 4,
"shape" : {
"x" : 32.0,
"y" : 4.5,
"width" : 3.0,
"height" : 1.5,
"type" : "RECTANGLE"
},
"reachDistance" : 0.0,
"changeAlgorithmType" : "SELECT_LIST",
"nextTarget" : [ 1 ],
"probabilityToChangeTarget" : [ 1.0 ]
}, {
"id" : 4,
"shape" : {
"x" : 52.0,
"y" : 4.5,
"width" : 3.0,
"height" : 1.5,
"type" : "RECTANGLE"
},
"reachDistance" : 0.0,
"changeAlgorithmType" : "SELECT_LIST",
"nextTarget" : [ 1 ],
"probabilityToChangeTarget" : [ 1.0 ]
} ],
"absorbingAreas" : [ ],
"sources" : [ {
"id" : 1,
"shape" : {
"x" : 72.5,
"y" : 0.5,
"width" : 5.0,
"height" : 3.0,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.NegativeExponentialDistribution",
"distributionParameters" : [ 0.6 ],
"spawnNumber" : 1,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 1000.0,
"spawnAtRandomPositions" : false,
"spawnAtGridPositionsCA" : false,
"useFreeSpaceOnly" : true,
"targetIds" : [ 2003 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN",
"attributesPedestrian" : null
}, {
"id" : 2,
"shape" : {
"x" : 77.5,
"y" : 0.5,
"width" : 1.0,
"height" : 3.0,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.NegativeExponentialDistribution",
"distributionParameters" : [ 100.0 ],
"spawnNumber" : 1,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 1000.0,
"spawnAtRandomPositions" : false,
"spawnAtGridPositionsCA" : false,
"useFreeSpaceOnly" : true,
"targetIds" : [ 2002 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN",
"attributesPedestrian" : null
}, {
"id" : 3,
"shape" : {
"x" : 78.5,
"y" : 0.5,
"width" : 1.0,
"height" : 3.0,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.NegativeExponentialDistribution",
"distributionParameters" : [ 200.0 ],
"spawnNumber" : 1,
"maxSpawnNumberTotal" : -1,
"startTime" : 50.0,
"endTime" : 1000.0,
"spawnAtRandomPositions" : false,
"spawnAtGridPositionsCA" : false,
"useFreeSpaceOnly" : true,
"targetIds" : [ 2001 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN",
"attributesPedestrian" : null
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.2,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footstepHistorySize" : 4,
"searchRadius" : 1.0,
"walkingDirectionCalculation" : "BY_TARGET_CENTER",
"walkingDirectionSameIfAngleLessOrEqual" : 45.0
},
"teleporter" : null,
"attributesCar" : {
"id" : -1,
"radius" : 0.2,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0,
"footstepHistorySize" : 4,
"searchRadius" : 1.0,
"walkingDirectionCalculation" : "BY_TARGET_CENTER",
"walkingDirectionSameIfAngleLessOrEqual" : 45.0,
"length" : 4.5,
"width" : 1.7,
"direction" : {
"x" : 1.0,
"y" : 0.0
}
}
},
"stimulusInfos" : [ ]
}
}
\ No newline at end of file
plants_controller
\ No newline at end of file
package org.vadere.simulator.models.strategy;
import org.vadere.simulator.models.Model;
public interface StrategyModel extends Model {
}
package org.vadere.simulator.models.strategy.navigation;
import org.vadere.simulator.models.strategy.StrategyModel;
public interface NavigationModel extends StrategyModel {
}
package org.vadere.simulator.models.strategy.navigation;
import org.vadere.simulator.projects.Domain;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.scenario.AttributesAgent;
import java.util.List;
import java.util.Random;
public class RouteChoiceThreeCorridors implements NavigationModel {
@Override
public void initialize(List<Attributes> attributesList, Domain domain, AttributesAgent attributesPedestrian, Random random) {
}
@Override
public void preLoop(double simTimeInSec) {
}
@Override
public void postLoop(double simTimeInSec) {
}
@Override
public void update(double simTimeInSec) {
}
}
......@@ -3,6 +3,7 @@ package org.vadere.simulator.projects;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.jetbrains.annotations.NotNull;
import org.vadere.simulator.models.strategy.StrategyModel;
import org.vadere.simulator.projects.io.JsonConverter;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.attributes.AttributesPsychology;
......@@ -31,6 +32,7 @@ public class ScenarioStore {
private String name;
private String description;
private String mainModel;
private String strategyModel;
private List<Attributes> attributesList;
private AttributesSimulation attributesSimulation;
private AttributesPsychology attributesPsychology;
......@@ -38,15 +40,16 @@ public class ScenarioStore {
private StimulusInfoStore stimulusInfoStore;
public ScenarioStore(final String name, final String description, final String mainModel, final List<Attributes> attributesModel,
final AttributesSimulation attributesSimulation, final Topography topography) {
this(name, description, mainModel, attributesModel, attributesSimulation, new AttributesPsychology(), topography, new StimulusInfoStore());
final AttributesSimulation attributesSimulation, final Topography topography, String strategyModel) {
this(name, description, mainModel, attributesModel, attributesSimulation, new AttributesPsychology(), topography, new StimulusInfoStore(), strategyModel);
}
public ScenarioStore(final String name, final String description, final String mainModel, final List<Attributes> attributesModel,
final AttributesSimulation attributesSimulation, final AttributesPsychology attributesPsychology, final Topography topography, final StimulusInfoStore stimulusInfoStore) {
final AttributesSimulation attributesSimulation, final AttributesPsychology attributesPsychology, final Topography topography, final StimulusInfoStore stimulusInfoStore, String strategyModel ) {
this.name = name;
this.description = description;
this.mainModel = mainModel;
this.strategyModel = strategyModel;
this.attributesList = attributesModel;
this.attributesSimulation = attributesSimulation;
this.attributesPsychology = attributesPsychology;
......@@ -65,7 +68,7 @@ public class ScenarioStore {
}
public ScenarioStore(final String name) {
this(name, "", null, new ArrayList<>(), new AttributesSimulation(), new Topography());
this(name, "", null, new ArrayList<>(), new AttributesSimulation(), new Topography(), null);
}
public AttributesCar getAttributesCar() {
......@@ -149,6 +152,10 @@ public class ScenarioStore {
return mainModel;
}
public String getStrategyModel(){
return strategyModel;
}
public String getName() {
return name;
}
......
......@@ -3,6 +3,7 @@ package org.vadere.simulator.projects.io;
import java.io.IOException;
import java.util.List;
import org.vadere.simulator.models.strategy.StrategyModel;
import org.vadere.util.version.Version;
import org.vadere.simulator.models.MainModel;
import org.vadere.simulator.projects.Scenario;
......@@ -59,10 +60,13 @@ public class JsonConverter {
Topography topography = StateJsonConverter.deserializeTopographyFromNode(scenarioNode.get("topography"));
StimulusInfoStore stimulusInfoStore = StateJsonConverter.deserializeStimuliFromArrayNode(scenarioNode.get("stimulusInfos"));
String strategyModel = scenarioNode.get("strategyModel").asText();
ScenarioStore scenarioStore = new ScenarioStore(scenarioName, scenarioDescription,
mainModel, attributesModel,
attributesSimulation, attributesPsychology,
topography, stimulusInfoStore);
topography, stimulusInfoStore,
strategyModel);
Scenario scenarioRunManager = new Scenario(scenarioStore);
scenarioRunManager.setDataProcessingJsonManager(DataProcessingJsonManager.deserializeFromNode(rootNode.get(DataProcessingJsonManager.DATAPROCCESSING_KEY)));
......@@ -109,6 +113,7 @@ public class JsonConverter {
ObjectNode vadereNode = StateJsonConverter.createObjectNode();
vadereNode.put(StateJsonConverter.MAIN_MODEL_KEY, scenarioStore.getMainModel());
vadereNode.put("strategyModel", scenarioStore.getStrategyModel());
ObjectNode attributesModelNode = StateJsonConverter.serializeAttributesModelToNode(scenarioStore.getAttributesList());
vadereNode.set("attributesModel", attributesModelNode);
......@@ -148,6 +153,7 @@ public class JsonConverter {
StateJsonConverter.deserializeAttributesSimulationFromNode(attributesSimulationNode),
StateJsonConverter.deserializeAttributesPsychologyFromNode(attributesPsychologyNode),
StateJsonConverter.deserializeTopographyFromNode(topographyNode),
StateJsonConverter.deserializeStimuliFromArrayNode(stimulusInfosArrayNode));
StateJsonConverter.deserializeStimuliFromArrayNode(stimulusInfosArrayNode),
scenarioStore.getStrategyModel());
}
}