Commit c127609b authored by Christina's avatar Christina

[WIP] handle null

parent 6b4d6907
Pipeline #301227 failed with stages
in 1 minute and 53 seconds
{
"name" : "Abstract2",
"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,
"countsInsteadOfDensity" : false
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaDensityCountingProcessor",
"id" : 6,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor",
"attributes" : {
"measurementAreaId" : 2002,
"countsInsteadOfDensity" : false
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaDensityCountingProcessor",
"id" : 7,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor",
"attributes" : {
"measurementAreaId" : 2003,
"countsInsteadOfDensity" : false
}
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.AreaDensityCountingProcessor",
"id" : 8,
"attributesType" : "org.vadere.state.attributes.processor.AttributesAreaDensityCountingProcessor",
"attributes" : {
"measurementAreaId" : 1000,
"countsInsteadOfDensity" : false
}
} ],
"isTimestamped" : false,
"isWriteMetaData" : false
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"strategyModel" : null,
"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" : 3.5,
"queueWidthLoading" : 1.0,
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT",
"width" : 0.2,
"height" : 1.0
}
}
},
"attributesSimulation" : {
"finishTime" : 1000.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" : 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
}, {
"shape" : {
"type" : "POLYGON",
"points" : [ {
"x" : 55.0,
"y" : 40.0
}, {
"x" : 79.5,
"y" : 40.0
}, {
"x" : 79.5,
"y" : 3.5
}, {
"x" : 74.4,
"y" : 3.5
}, {
"x" : 74.4,
"y" : 20.0
}, {
"x" : 59.9,
"y" : 20.0
}, {
"x" : 59.9,
"y" : 3.5
}, {
"x" : 54.9,
"y" : 3.5
} ]
},
"id" : 8
} ],
"measurementAreas" : [ {
"shape" : {
"x" : 68.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" : 20.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
}, {
"id" : 2004,
"absorbing" : false,
"shape" : {
"x" : 60.1,
"y" : 19.2,
"width" : 14.0,
"height" : 0.5,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
}, {
"id" : 5001,
"absorbing" : false,
"shape" : {
"x" : 64.2,
"y" : 14.0,
"width" : 5.0,
"height" : 5.0,
"type" : "RECTANGLE"
},
"waitingTime" : 30.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 ]
}, {
"id" : 9,
"shape" : {
"x" : 60.0,
"y" : 9.3,
"width" : 14.1,
"height" : 4.0,
"type" : "RECTANGLE"
},
"reachDistance" : 0.0,
"changeAlgorithmType" : "SELECT_LIST",
"nextTarget" : [ 5001, 2002 ],
"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" : [ 2.5 ],
"spawnNumber" : 5,
"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
......@@ -74,7 +74,7 @@
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"strategyModel" : "RouteChoiceThreeCorridors",
"strategyModel" : "\"RouteChoiceThreeCorridors\"",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" : 4,
......@@ -120,7 +120,7 @@
"obstacleDensityWeight" : 3.5,
"pedestrianSameTargetDensityWeight" : 3.5,
"pedestrianOtherTargetDensityWeight" : 3.5,
"pedestrianWeight" : 30.0,
"pedestrianWeight" : 3.5,
"queueWidthLoading" : 1.0,
"pedestrianDynamicWeight" : 6.0,
"loadingType" : "CONSTANT",
......@@ -130,7 +130,7 @@
}
},
"attributesSimulation" : {
"finishTime" : 10.0,
"finishTime" : 1000.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.1,
"writeSimulationData" : true,
......
......@@ -77,13 +77,13 @@ public class ModelPresets {
// Behavioural Heuristics Model
list.clear();
list.add(AttributesBHM.class);
registerModelPreset(BehaviouralHeuristicsModel.class, list);
registerModelPreset(BehaviouralHeuristicsModel.class, list );
// Biomechanics Model
list.clear();
list.add(AttributesBMM.class);
list.add(AttributesBHM.class);
registerModelPreset(BiomechanicsModel.class, list);
registerModelPreset(BiomechanicsModel.class, list );
// SelfCatThreat Model
list.clear();
......@@ -98,9 +98,9 @@ public class ModelPresets {
}
private void registerModelPreset(Class<? extends MainModel> mainModelClass,
List<Class<? extends Attributes>> attributesClasses) {
List<Class<? extends Attributes>> attributesClasses) {
ModelDefinition definition = new ModelDefinition(mainModelClass.getName(), "123" , null);
ModelDefinition definition = new ModelDefinition(mainModelClass.getName(), null , null);
definition.createAndSetDefaultAttributes(attributesClasses);
modelDefinitionPresets.add(definition);
}
......
......@@ -8,6 +8,7 @@ import org.vadere.gui.postvisualization.view.PostvisualizationWindow;
import org.vadere.gui.projectview.control.IProjectChangeListener;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.gui.topographycreator.view.TopographyWindow;
import org.vadere.simulator.control.strategy.models.IStrategyModel;
import org.vadere.simulator.models.ModelHelper;
import org.vadere.simulator.projects.ProjectFinishedListener;
import org.vadere.simulator.projects.Scenario;
......@@ -133,6 +134,8 @@ public class ScenarioPanel extends JPanel implements IProjectChangeListener, Pro
Messages.getString("Tab.Model.confirmLoadTemplate.title"),
JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
try {
String strategyModelString = scenario.getScenarioStore().getStrategyModel();
modelDefinition.setStrategyModel(strategyModelString);
attributesModelView.setText(StateJsonConverter.serializeModelPreset(modelDefinition));
} catch (Exception e1) {
e1.printStackTrace();
......
<
......@@ -214,8 +214,9 @@ public class Simulation {
for (Model m : models) {
m.preLoop(simTimeInSec);
}
strategyModel.initialize(simTimeInSec);
if (strategyModel != null){
strategyModel.initialize(simTimeInSec);
}
for (PassiveCallback c : passiveCallbacks) {
c.preLoop(simTimeInSec);
......@@ -424,13 +425,14 @@ public class Simulation {
private void updateStrategyLayer(double simTimeInSec) {