Commit 02163ddc authored by Benedikt Zoennchen's avatar Benedikt Zoennchen

issue #146 Resolve major bug in InterpolationUtil which was an issue for the GNM and the SFM!

parent 0ac1d206
{
"name" : "basic_1_chicken_gnm1_displaced",
"description" : "",
"release" : "0.6",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"isTimestamped" : true
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.gnm.GradientNavigationModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"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"
}
},
"org.vadere.state.attributes.models.AttributesGNM" : {
"attributesODEIntegrator" : {
"solverType" : "DORMAND_PRINCE_45",
"stepSizeMin" : 1.0E-4,
"stepSizeMax" : 1.0,
"toleranceAbsolute" : 1.0E-5,
"toleranceRelative" : 1.0E-4
},
"floorGradientProviderType" : "FLOOR_EIKONAL_DISCRETE",
"targetPotentialModel" : "org.vadere.simulator.models.potential.fields.PotentialFieldTargetGrid",
"pedestrianPotentialModel" : "org.vadere.simulator.models.gnm.PotentialFieldPedestrianGNM",
"obstaclePotentialModel" : "org.vadere.simulator.models.gnm.PotentialFieldObstacleGNM"
},
"org.vadere.state.attributes.models.AttributesPotentialGNM" : {
"pedestrianBodyPotential" : 3.59,
"pedestrianRecognitionDistance" : 0.7,
"obstacleBodyPotential" : 20.1,
"obstacleRepulsionStrength" : 0.25
}
},
"attributesSimulation" : {
"finishTime" : 200.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.0,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 1,
"simulationSeed" : 1
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : -189.0,
"y" : 186.0,
"width" : 35.0,
"height" : 60.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true
},
"obstacles" : [ {
"shape" : {
"x" : -179.0,
"y" : 226.0,
"width" : 15.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"id" : -1
}, {
"shape" : {
"x" : -180.0,
"y" : 207.0,
"width" : 1.0,
"height" : 20.0,
"type" : "RECTANGLE"
},
"id" : -1
}, {
"shape" : {
"x" : -164.0,
"y" : 207.0,
"width" : 1.0,
"height" : 20.0,
"type" : "RECTANGLE"
},
"id" : -1
} ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : -179.0,
"y" : 237.0,
"width" : 15.0,
"height" : 5.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"sources" : [ {
"id" : -1,
"shape" : {
"x" : -179.0,
"y" : 192.0,
"width" : 15.0,
"height" : 5.0,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.ConstantDistribution",
"distributionParameters" : [ 1.0 ],
"spawnNumber" : 200,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 0.0,
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : true,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null
}
}
}
\ No newline at end of file
{
"name" : "chicken_floorfield_displaced_ok",
"description" : "",
"release" : "0.6",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.PedestrianIdOutputFile",
"filename" : "waitingTimes.txt",
"processors" : [ 2 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOverlapOutputFile",
"filename" : "out.txt",
"processors" : [ 3 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.NoDataKeyOutputFile",
"filename" : "out1.txt",
"processors" : [ 4 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianWaitingTimeProcessor",
"id" : 2,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianWaitingTimeProcessor",
"attributes" : {
"waitingArea" : {
"x" : 10.0,
"y" : 32.0,
"width" : 15.0,
"height" : 8.0,
"type" : "RECTANGLE"
}
}
}, {
"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.MaxOverlapProcessor",
"id" : 5,
"attributesType" : "org.vadere.state.attributes.processor.AttributesMaxOverlapProcessor",
"attributes" : {
"pedestrianOverlapProcessorId" : 3
}
} ],
"isTimestamped" : true
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.osm.OptimalStepsModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"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"
}
},
"org.vadere.state.attributes.models.AttributesOSM" : {
"stepCircleResolution" : 18,
"numberOfCircles" : 1,
"varyStepDirection" : false,
"stepLengthIntercept" : 0.4625,
"stepLengthSlopeSpeed" : 0.2345,
"stepLengthSD" : 0.036,
"movementThreshold" : 0.0,
"optimizationType" : "NELDER_MEAD",
"movementType" : "ARBITRARY",
"dynamicStepLength" : false,
"updateType" : "EVENT_DRIVEN",
"seeSmallWalls" : false,
"minimumStepLength" : 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
}
},
"attributesSimulation" : {
"finishTime" : 200.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.0,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 1,
"simulationSeed" : 1
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 15.0,
"y" : -10.0,
"width" : 35.0,
"height" : 60.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true
},
"obstacles" : [ {
"shape" : {
"x" : 24.0,
"y" : 11.0,
"width" : 1.0,
"height" : 20.0,
"type" : "RECTANGLE"
},
"id" : -1
}, {
"shape" : {
"x" : 40.0,
"y" : 11.0,
"width" : 1.0,
"height" : 20.0,
"type" : "RECTANGLE"
},
"id" : -1
}, {
"shape" : {
"x" : 25.0,
"y" : 30.0,
"width" : 15.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"id" : -1
} ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : 25.0,
"y" : 41.0,
"width" : 15.0,
"height" : 5.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"sources" : [ {
"id" : -1,
"shape" : {
"x" : 25.0,
"y" : -5.0,
"width" : 15.0,
"height" : 9.0,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.ConstantDistribution",
"distributionParameters" : [ 1.0 ],
"spawnNumber" : 300,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 0.0,
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : true,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null
}
}
}
\ No newline at end of file
{
"name" : "basic_1_chicken_sfm1_displaced",
"description" : "",
"release" : "0.6",
"processWriters" : {
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "postvis.trajectories",
"processors" : [ 1 ]
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.PedestrianIdOutputFile",
"filename" : "waitingTimes.txt",
"processors" : [ 2 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 1
}, {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianWaitingTimeProcessor",
"id" : 2,
"attributesType" : "org.vadere.state.attributes.processor.AttributesPedestrianWaitingTimeProcessor",
"attributes" : {
"waitingArea" : {
"x" : 10.0,
"y" : 32.0,
"width" : 15.0,
"height" : 8.0,
"type" : "RECTANGLE"
}
}
} ],
"isTimestamped" : true
},
"scenario" : {
"mainModel" : "org.vadere.simulator.models.sfm.SocialForceModel",
"attributesModel" : {
"org.vadere.state.attributes.models.AttributesFloorField" : {
"createMethod" : "HIGH_ACCURACY_FAST_MARCHING",
"potentialFieldResolution" : 0.1,
"obstacleGridPenalty" : 0.1,
"targetAttractionStrength" : 1.0,
"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"
}
},
"org.vadere.state.attributes.models.AttributesPotentialSFM" : {
"pedestrianBodyPotential" : 2.72,
"pedestrianRecognitionDistance" : 0.3,
"obstacleBodyPotential" : 10.0,
"obstacleRepulsionStrength" : 0.2
},
"org.vadere.state.attributes.models.AttributesSFM" : {
"attributesODEIntegrator" : {
"solverType" : "DORMAND_PRINCE_45",
"stepSizeMin" : 1.0E-4,
"stepSizeMax" : 1.0,
"toleranceAbsolute" : 1.0E-5,
"toleranceRelative" : 1.0E-4
},
"floorGradientProviderType" : "FLOOR_EIKONAL_DISCRETE",
"targetPotentialModel" : "org.vadere.simulator.models.potential.fields.PotentialFieldTargetGrid",
"pedestrianPotentialModel" : "org.vadere.simulator.models.sfm.PotentialFieldPedestrianSFM",
"obstaclePotentialModel" : "org.vadere.simulator.models.sfm.PotentialFieldObstacleSFM"
}
},
"attributesSimulation" : {
"finishTime" : 200.0,
"simTimeStepLength" : 0.4,
"realTimeSimTimeRatio" : 0.0,
"writeSimulationData" : true,
"visualizationEnabled" : true,
"printFPS" : false,
"digitsPerCoordinate" : 2,
"useFixedSeed" : true,
"fixedSeed" : 1,
"simulationSeed" : 0
},
"topography" : {
"attributes" : {
"bounds" : {
"x" : 15.0,
"y" : -10.0,
"width" : 35.0,
"height" : 60.0
},
"boundingBoxWidth" : 0.5,
"bounded" : true
},
"obstacles" : [ {
"shape" : {
"x" : 25.0,
"y" : 30.0,
"width" : 15.0,
"height" : 1.0,
"type" : "RECTANGLE"
},
"id" : -1
}, {
"shape" : {
"x" : 24.0,
"y" : 11.0,
"width" : 1.0,
"height" : 20.0,
"type" : "RECTANGLE"
},
"id" : -1
}, {
"shape" : {
"x" : 40.0,
"y" : 11.0,
"width" : 1.0,
"height" : 20.0,
"type" : "RECTANGLE"
},
"id" : -1
} ],
"stairs" : [ ],
"targets" : [ {
"id" : 1,
"absorbing" : true,
"shape" : {
"x" : 25.0,
"y" : 41.0,
"width" : 15.0,
"height" : 5.0,
"type" : "RECTANGLE"
},
"waitingTime" : 0.0,
"waitingTimeYellowPhase" : 0.0,
"parallelWaiters" : 0,
"individualWaiting" : true,
"deletionDistance" : 0.1,
"startingWithRedLight" : false,
"nextSpeed" : -1.0
} ],
"sources" : [ {
"id" : -1,
"shape" : {
"x" : 25.0,
"y" : -4.0,
"width" : 15.0,
"height" : 5.0,
"type" : "RECTANGLE"
},
"interSpawnTimeDistribution" : "org.vadere.state.scenario.ConstantDistribution",
"distributionParameters" : [ 1.0 ],
"spawnNumber" : 50,
"maxSpawnNumberTotal" : -1,
"startTime" : 0.0,
"endTime" : 0.0,
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : true,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
"attributesPedestrian" : {
"radius" : 0.195,
"densityDependentSpeed" : false,
"speedDistributionMean" : 1.34,
"speedDistributionStandardDeviation" : 0.26,
"minimumSpeed" : 0.5,
"maximumSpeed" : 2.2,
"acceleration" : 2.0
},
"attributesCar" : null
}
}
}
\ No newline at end of file
......@@ -232,12 +232,12 @@ public class InterpolationUtil {
*/
public static void getGradientMollified(CellGrid pot, double[] x,
double[] grad, double gradientMollifierRadius) {
double aX = Math.max(0, x[0] - gradientMollifierRadius);
double bX = Math.min(pot.getNumPointsX() - 1, x[0]
+ gradientMollifierRadius);
double aY = Math.max(0, x[1] - gradientMollifierRadius);
double bY = Math.min(pot.getNumPointsY() - 1, x[1]
+ gradientMollifierRadius);
double aX = Math.max(pot.getMinX(), x[0] - gradientMollifierRadius);
double bX = Math.min(pot.getMaxX(), x[0] + gradientMollifierRadius);
double aY = Math.max(pot.getMinY(), x[1] - gradientMollifierRadius);
double bY = Math.min(pot.getMaxY(), x[1] + gradientMollifierRadius);
double[] xMoll = new double[2];
double[] cgrad = new double[2];
......@@ -262,10 +262,15 @@ public class InterpolationUtil {
MathUtil.cutExpGrad2D(xMoll, gradientMollifierRadius, cgrad);
// get the potential at the current position
double xDisplaced = (cx + x[0] - pot.getMinX());
double yDisplaced = (cy + x[1] - pot.getMinY());
double potValue = InterpolationUtil
.getValueByTriangleInterpolation(pot,
(cx + x[0]) / pot.getResolution(), (cy + x[1])
/ pot.getResolution());
.getValueByTriangleInterpolation(
pot,
xDisplaced / pot.getResolution(),
yDisplaced / pot.getResolution());
if (potValue > 9999 || Double.isInfinite(potValue)
|| Double.isNaN(potValue)) {
potValue = 9999;
......
......@@ -278,6 +278,14 @@ public class CellGrid {
public double getMinY() { return yMin; }
public double getMaxX () {
return xMin + width;
}
public double getMaxY() {
return yMin + height;
}
public boolean isValidPoint(Point point) {
return isValidPoint(point.x, point.y);
}
......
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