10.12., 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit d380bf90 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen

GPU osm copy potential field onto the gpu.

parent e3c08bfb
......@@ -145,6 +145,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -145,6 +145,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -145,6 +145,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -169,6 +169,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -144,6 +144,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -144,6 +144,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -144,6 +144,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -144,6 +144,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -144,6 +144,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -144,6 +144,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -144,6 +144,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -146,6 +146,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -220,6 +220,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : true,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -220,6 +220,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : true,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -118,6 +118,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -118,6 +118,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -118,6 +118,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -118,6 +118,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -118,6 +118,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -136,6 +136,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -167,6 +167,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -170,6 +170,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ {
......
......@@ -132,6 +132,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -118,6 +118,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -118,6 +118,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -211,6 +211,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -202,6 +202,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -552,6 +552,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -571,6 +572,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -590,6 +592,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -609,6 +612,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -628,6 +632,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -647,6 +652,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -666,6 +672,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 2 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -685,6 +692,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 2 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -704,6 +712,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -723,6 +732,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 2 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -742,6 +752,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 2 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
}, {
"id" : -1,
......@@ -761,6 +772,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -190,6 +190,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -154,6 +154,7 @@
"spawnAtRandomPositions" : true,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -150,6 +150,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -150,6 +150,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -200,6 +200,7 @@
"spawnAtRandomPositions" : false,
"useFreeSpaceOnly" : false,
"targetIds" : [ 1 ],
"groupSizeDistribution" : [ 0.0, 0.0, 1.0 ],
"dynamicElementType" : "PEDESTRIAN"
} ],
"dynamicElements" : [ ],
......
......@@ -37,10 +37,6 @@ public class ParticleSwarmOptimizer implements StepCircleOptimizer {
VCircle circle = ((VCircle) reachableArea);
double stepSize = circle.getRadius();
final PotentialEvaluationFunction potentialEvaluationFunction = new PotentialEvaluationFunction(pedestrian);
potentialEvaluationFunction.setStepSize(stepSize);
List<VPoint> positions = StepCircleOptimizerDiscrete.getReachablePositions(pedestrian, random);
// maximum possible angle of movement relative to ankerAngle
double angle;
......
......@@ -67,4 +67,8 @@ public class ObstacleDistancePotential implements IPotentialField {
public double getPotential(@NotNull VPoint pos, @Nullable Agent agent) {
return eikonalSolver.getPotential(pos, 0.0, 1.0);
}
public EikonalSolver getEikonalSolver() {
return eikonalSolver;
}
}
......@@ -14,6 +14,7 @@ import org.vadere.state.scenario.Topography;
import org.vadere.util.geometry.Vector2D;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.potential.calculators.EikonalSolver;
/**
* A IPotentialTargetGrid, that creates for a single target the a floor field
......@@ -27,6 +28,7 @@ public class PotentialFieldSingleTargetGrid extends AbstractPotentialFieldTarget
private AttributesFloorField attributesFloorField;
private AttributesAgent attributesPedestrian;
private final int targetId;
private EikonalSolver eikonalSolver;
public PotentialFieldSingleTargetGrid(final Topography topography,
final AttributesAgent attributesPedestrian,
......@@ -71,9 +73,14 @@ public class PotentialFieldSingleTargetGrid extends AbstractPotentialFieldTarget
PotentialFieldAndInitializer potentialFieldAndInitializer = PotentialFieldAndInitializer.create(topography,
targetId, shapes, this.attributesPedestrian, this.attributesFloorField);
targetPotentialFields.put(targetId, potentialFieldAndInitializer);
eikonalSolver = potentialFieldAndInitializer.eikonalSolver;
}
}
public EikonalSolver getEikonalSolver() {
return eikonalSolver;
}
@Override
public void postLoop(double simTimeInSec) {}
......
package org.vadere.simulator.models.seating.osm.opencl;
import org.junit.Before;
import org.junit.Test;
import org.vadere.simulator.models.osm.PedestrianOSM;
import org.vadere.simulator.models.osm.opencl.CLOptimalStepsModel;
import org.vadere.simulator.models.potential.fields.ObstacleDistancePotential;
import org.vadere.simulator.models.potential.fields.PotentialFieldSingleTargetGrid;
import org.vadere.simulator.projects.io.IOVadere;
import org.vadere.state.attributes.models.AttributesFloorField;
import org.vadere.state.attributes.models.AttributesOSM;
import org.vadere.state.attributes.models.AttributesPotentialCompact;
import org.vadere.state.attributes.scenario.AttributesAgent;
import org.vadere.state.scenario.Topography;
import org.vadere.state.util.StateJsonConverter;
import org.vadere.state.util.TextOutOfNodeException;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.opencl.OpenCLException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import static org.junit.Assert.assertEquals;
/**
* @author Benedikt Zoennchen
*/
public class TestCLOptimalStepsModel {
private String topographyStringChicken = "{\n" +
" \"attributes\" : {\n" +
" \"bounds\" : {\n" +
" \"x\" : 0.0,\n" +
" \"y\" : 0.0,\n" +
" \"width\" : 35.0,\n" +
" \"height\" : 60.0\n" +
" },\n" +
" \"boundingBoxWidth\" : 0.5,\n" +
" \"bounded\" : true\n" +
" },\n" +
" \"obstacles\" : [ {\n" +
" \"shape\" : {\n" +
" \"x\" : 9.0,\n" +
" \"y\" : 21.0,\n" +
" \"width\" : 1.0,\n" +
" \"height\" : 20.0,\n" +
" \"type\" : \"RECTANGLE\"\n" +
" },\n" +
" \"id\" : -1\n" +
" }, {\n" +
" \"shape\" : {\n" +
" \"x\" : 25.0,\n" +
" \"y\" : 21.0,\n" +
" \"width\" : 1.0,\n" +
" \"height\" : 20.0,\n" +
" \"type\" : \"RECTANGLE\"\n" +
" },\n" +
" \"id\" : -1\n" +
" }, {\n" +
" \"shape\" : {\n" +
" \"x\" : 10.0,\n" +
" \"y\" : 40.0,\n" +
" \"width\" : 15.0,\n" +
" \"height\" : 1.0,\n" +
" \"type\" : \"RECTANGLE\"\n" +
" },\n" +
" \"id\" : -1\n" +