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

Commit 21db25d3 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen

triangulation updates

parent f26b2c4a
...@@ -84,16 +84,20 @@ ...@@ -84,16 +84,20 @@
"type" : "POLYGON", "type" : "POLYGON",
"points" : [ { "points" : [ {
"x" : 9.0, "x" : 9.0,
"y" : 12.0 "y" : 12.0,
"identifier" : -1
}, { }, {
"x" : 9.0, "x" : 9.0,
"y" : 10.0 "y" : 10.0,
"identifier" : -1
}, { }, {
"x" : 30.0, "x" : 30.0,
"y" : 7.0 "y" : 7.0,
"identifier" : -1
}, { }, {
"x" : 30.0, "x" : 30.0,
"y" : 12.0 "y" : 12.0,
"identifier" : -1
} ] } ]
}, },
"id" : -1 "id" : -1
...@@ -102,16 +106,20 @@ ...@@ -102,16 +106,20 @@
"type" : "POLYGON", "type" : "POLYGON",
"points" : [ { "points" : [ {
"x" : 9.0, "x" : 9.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
}, { }, {
"x" : 9.0, "x" : 9.0,
"y" : 2.0 "y" : 2.0,
"identifier" : -1
}, { }, {
"x" : 30.0, "x" : 30.0,
"y" : 5.0 "y" : 5.0,
"identifier" : -1
}, { }, {
"x" : 30.0, "x" : 30.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} ] } ]
}, },
"id" : -1 "id" : -1
......
...@@ -146,7 +146,8 @@ ...@@ -146,7 +146,8 @@
"treadCount" : 1, "treadCount" : 1,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -146,7 +146,8 @@ ...@@ -146,7 +146,8 @@
"treadCount" : 1, "treadCount" : 1,
"upwardDirection" : { "upwardDirection" : {
"x" : -1.0, "x" : -1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : -1.0, "x" : -1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : -1.0, "x" : -1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : -1.0, "x" : -1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : -1.0, "x" : -1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : -1.0, "x" : -1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 100, "treadCount" : 100,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
"treadCount" : 133, "treadCount" : 133,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -3,8 +3,15 @@ ...@@ -3,8 +3,15 @@
"description" : "", "description" : "",
"release" : "0.2", "release" : "0.2",
"processWriters" : { "processWriters" : {
"files" : [ ], "files" : [ {
"processors" : [ ], "type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "out.trajectories",
"processors" : [ 1 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 1
} ],
"isTimestamped" : true "isTimestamped" : true
}, },
"scenario" : { "scenario" : {
......
...@@ -142,11 +142,13 @@ ...@@ -142,11 +142,13 @@
"targetIds" : [ 1 ], "targetIds" : [ 1 ],
"position" : { "position" : {
"x" : 4.3, "x" : 4.3,
"y" : 4.6 "y" : 4.6,
"identifier" : -1
}, },
"velocity" : { "velocity" : {
"x" : 0.0, "x" : 0.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
}, },
"nextTargetListIndex" : -1, "nextTargetListIndex" : -1,
"freeFlowSpeed" : 1.34, "freeFlowSpeed" : 1.34,
......
...@@ -1568,7 +1568,8 @@ ...@@ -1568,7 +1568,8 @@
"treadCount" : 13, "treadCount" : 13,
"upwardDirection" : { "upwardDirection" : {
"x" : -1.0, "x" : -1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
}, { }, {
"shape" : { "shape" : {
...@@ -1582,7 +1583,8 @@ ...@@ -1582,7 +1583,8 @@
"treadCount" : 13, "treadCount" : 13,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -160,28 +160,36 @@ ...@@ -160,28 +160,36 @@
"type" : "POLYGON", "type" : "POLYGON",
"points" : [ { "points" : [ {
"x" : 31.0, "x" : 31.0,
"y" : 27.0 "y" : 27.0,
"identifier" : -1
}, { }, {
"x" : 2.0, "x" : 2.0,
"y" : 27.0 "y" : 27.0,
"identifier" : -1
}, { }, {
"x" : 2.0, "x" : 2.0,
"y" : 29.0 "y" : 29.0,
"identifier" : -1
}, { }, {
"x" : 33.0, "x" : 33.0,
"y" : 29.0 "y" : 29.0,
"identifier" : -1
}, { }, {
"x" : 33.0, "x" : 33.0,
"y" : 2.0 "y" : 2.0,
"identifier" : -1
}, { }, {
"x" : 2.0, "x" : 2.0,
"y" : 2.0 "y" : 2.0,
"identifier" : -1
}, { }, {
"x" : 2.0, "x" : 2.0,
"y" : 4.0 "y" : 4.0,
"identifier" : -1
}, { }, {
"x" : 31.0, "x" : 31.0,
"y" : 4.0 "y" : 4.0,
"identifier" : -1
} ] } ]
}, },
"waitingTime" : 0.0, "waitingTime" : 0.0,
......
...@@ -151,28 +151,36 @@ ...@@ -151,28 +151,36 @@
"type" : "POLYGON", "type" : "POLYGON",
"points" : [ { "points" : [ {
"x" : 31.0, "x" : 31.0,
"y" : 27.0 "y" : 27.0,
"identifier" : -1
}, { }, {
"x" : 2.0, "x" : 2.0,
"y" : 27.0 "y" : 27.0,
"identifier" : -1
}, { }, {
"x" : 2.0, "x" : 2.0,
"y" : 29.0 "y" : 29.0,
"identifier" : -1
}, { }, {
"x" : 33.0, "x" : 33.0,
"y" : 29.0 "y" : 29.0,
"identifier" : -1
}, { }, {
"x" : 33.0, "x" : 33.0,
"y" : 2.0 "y" : 2.0,
"identifier" : -1
}, { }, {
"x" : 2.0, "x" : 2.0,
"y" : 2.0 "y" : 2.0,
"identifier" : -1
}, { }, {
"x" : 2.0, "x" : 2.0,
"y" : 4.0 "y" : 4.0,
"identifier" : -1
}, { }, {
"x" : 31.0, "x" : 31.0,
"y" : 4.0 "y" : 4.0,
"identifier" : -1
} ] } ]
}, },
"waitingTime" : 0.0, "waitingTime" : 0.0,
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
"treadCount" : 15, "treadCount" : 15,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -110,7 +110,8 @@ ...@@ -110,7 +110,8 @@
"treadCount" : 15, "treadCount" : 15,
"upwardDirection" : { "upwardDirection" : {
"x" : 1.0, "x" : 1.0,
"y" : 0.0 "y" : 0.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -146,7 +146,8 @@ ...@@ -146,7 +146,8 @@
"treadCount" : 13, "treadCount" : 13,
"upwardDirection" : { "upwardDirection" : {
"x" : 0.0, "x" : 0.0,
"y" : 1.0 "y" : 1.0,
"identifier" : -1
} }
}, { }, {
"shape" : { "shape" : {
...@@ -160,7 +161,8 @@ ...@@ -160,7 +161,8 @@
"treadCount" : 13, "treadCount" : 13,
"upwardDirection" : { "upwardDirection" : {
"x" : 0.0, "x" : 0.0,
"y" : -1.0 "y" : -1.0,
"identifier" : -1
} }
} ], } ],
"targets" : [ { "targets" : [ {
......
...@@ -129,6 +129,5 @@ public class TrajectoryReader { ...@@ -129,6 +129,5 @@ public class TrajectoryReader {
logger.warn("could not read trajectory file. The file format might not be compatible or it is missing."); logger.warn("could not read trajectory file. The file format might not be compatible or it is missing.");
throw e; throw e;
} }
} }
} }
...@@ -288,6 +288,13 @@ public interface IPolyConnectivity<P extends IPoint, V extends IVertex<P>, E ext ...@@ -288,6 +288,13 @@ public interface IPolyConnectivity<P extends IPoint, V extends IVertex<P>, E ext
return GeometryUtils.isRightOf(p1, p2, x1, y1); return GeometryUtils.isRightOf(p1, p2, x1, y1);
} }
/**
* Tests if the line-segment edge intersects the line defined by p1 and p2.
* @param p1
* @param p2
* @param edge
* @return
*/
default boolean intersects(final IPoint p1, final IPoint p2, E edge) { default boolean intersects(final IPoint p1, final IPoint p2, E edge) {
VPoint q1 = getMesh().toPoint(getMesh().getVertex(getMesh().getPrev(edge))); VPoint q1 = getMesh().toPoint(getMesh().getVertex(getMesh().getPrev(edge)));
VPoint q2 = getMesh().toPoint(getMesh().getVertex(edge)); VPoint q2 = getMesh().toPoint(getMesh().getVertex(edge));
......
...@@ -751,30 +751,17 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte ...@@ -751,30 +751,17 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
* @param stopCondition * @param stopCondition
* @return * @return
*/ */
default F straightWalk2D(final E startVertex, final VPoint direction, final Predicate<E> stopCondition) { default F straightWalk2D(final E startVertex, final F face, final VPoint direction, final Predicate<E> stopCondition) {
E startEdge = getMesh().getPrev(startVertex); E edge = getMesh().getPrev(startVertex);
VPoint p1 = getMesh().toPoint(startVertex); VPoint p1 = getMesh().toPoint(startVertex);
VPoint p2 = p1.add(direction);
VPoint p3 = getMesh().toPoint(startEdge);
VPoint p4 = getMesh().toPoint(getMesh().getPrev(startEdge));
VPoint q = p1; assert intersects(p1, p1.add(direction), edge);
VPoint p = GeometryUtils.intersectionPoint(p1.getX(), p1.getY(), p2.getX(), p2.getY(), p3.getX(), p3.getY(), p4.getX(), p4.getY()); assert getMesh().getEdges(face).contains(startVertex);
// TODO: quick solution!
F face; VPoint q = p1.add(direction.scalarMultiply(Double.MAX_VALUE * 0.5));
E edge; return straightWalk2D(p1, q, face, edge, e -> (stopCondition.test(e) || !isRightOf(q.x, q.y, e)));
if(isRightOf(p.getX(), p.getY(), startEdge)) {
edge = startEdge;
face = getMesh().getFace(edge);
}
else {