Commit f9b5d672 authored by Julian Zobel's avatar Julian Zobel
Browse files

POM Update & Updated lib usage

parent 282df4c4
...@@ -48,8 +48,7 @@ ...@@ -48,8 +48,7 @@
<repositories> <repositories>
<!-- simonstrator-repository --> <!-- simonstrator-repository -->
<!--
<repository> <repository>
<id>simonstrator</id> <id>simonstrator</id>
<url>https://dev.kom.e-technik.tu-darmstadt.de/mvn/</url> <url>https://dev.kom.e-technik.tu-darmstadt.de/mvn/</url>
...@@ -60,13 +59,14 @@ ...@@ -60,13 +59,14 @@
<updatePolicy>always</updatePolicy> <updatePolicy>always</updatePolicy>
</releases> </releases>
</repository> </repository>
-->
<!-- local kom repository --> <!-- local kom repository -->
<!-- <repository> <!--
<repository>
<id>maven.kom</id> <id>maven.kom</id>
<url>http://www.kom.tu-darmstadt.de/~stingl/PeerfactSim.KOM-Libraries/maven2/</url> <url>http://www.kom.tu-darmstadt.de/~stingl/PeerfactSim.KOM-Libraries/maven2/</url>
</repository> --> </repository> -->
<!-- -->
<!-- jgrapht can be found there --> <!-- jgrapht can be found there -->
<!-- <!--
...@@ -83,6 +83,8 @@ ...@@ -83,6 +83,8 @@
<url>http://uk.maven.org/maven2</url> <url>http://uk.maven.org/maven2</url>
</repository> </repository>
--> -->
<repository> <repository>
<id>Google Maven Central</id> <id>Google Maven Central</id>
<url>https://maven-central.storage.googleapis.com/repos/central/data/</url> <url>https://maven-central.storage.googleapis.com/repos/central/data/</url>
...@@ -95,35 +97,35 @@ ...@@ -95,35 +97,35 @@
</repository> </repository>
</repositories> </repositories>
<dependencies> <dependencies>
<!-- XML --> <!-- XML -->
<!-- https://mvnrepository.com/artifact/org.dom4j/dom4j --> <!-- https://mvnrepository.com/artifact/javax.xml/jsr173 -->
<!--
<dependency> <dependency>
<groupId>org.dom4j</groupId> <groupId>javax.xml</groupId>
<artifactId>dom4j</artifactId> <artifactId>jsr173</artifactId>
<version>2.1.3</version> <version>1.0</version>
</dependency> </dependency>
-->
<!-- https://mvnrepository.com/artifact/stax/stax --> <!-- https://mvnrepository.com/artifact/stax/stax -->
<dependency> <dependency>
<groupId>stax</groupId> <groupId>stax</groupId>
<artifactId>stax</artifactId> <artifactId>stax</artifactId>
<version>1.2.0</version> <version>1.2.0</version>
</dependency> </dependency>
<!--
<dependency> <dependency>
<groupId>stax</groupId> <groupId>stax</groupId>
<artifactId>utils</artifactId> <artifactId>utils</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
-->
<dependency> <dependency>
<groupId>xerces</groupId> <groupId>xerces</groupId>
...@@ -153,10 +155,7 @@ ...@@ -153,10 +155,7 @@
<version>1.4</version> <version>1.4</version>
</dependency> </dependency>
<!-- Logging --> <!-- Logging -->
<!-- unused <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version> </dependency> <dependency> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <version>1.6.1</version> </dependency> -->
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
...@@ -220,8 +219,11 @@ ...@@ -220,8 +219,11 @@
<version>4.3.10.Final</version> <version>4.3.10.Final</version>
</dependency> </dependency>
<dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> <dependency>
<version>3.7.2</version> </dependency> <groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.7.2</version>
</dependency>
<!-- Glab Database --> <!-- Glab Database -->
<dependency> <dependency>
...@@ -413,7 +415,6 @@ ...@@ -413,7 +415,6 @@
<version>0.1-SNAPSHOT</version> <version>0.1-SNAPSHOT</version>
</dependency> </dependency>
--> -->
</dependencies> </dependencies>
</project> </project>
...@@ -24,11 +24,13 @@ import java.util.Collection; ...@@ -24,11 +24,13 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.jgrapht.Graph;
import org.jgrapht.graph.DefaultWeightedEdge;
import de.tud.kom.p2psim.api.topology.obstacles.ObstacleModel; import de.tud.kom.p2psim.api.topology.obstacles.ObstacleModel;
import de.tud.kom.p2psim.api.util.geo.maps.Map; import de.tud.kom.p2psim.api.util.geo.maps.Map;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.DefaultWeightedEdgeRetrievableGraph; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tud.kom.p2psim.impl.util.Tuple; import de.tud.kom.p2psim.impl.util.Tuple;
...@@ -80,7 +82,7 @@ public interface WaypointModel { ...@@ -80,7 +82,7 @@ public interface WaypointModel {
* @param waypoint * @param waypoint
* @return * @return
*/ */
public abstract List<Tuple<Waypoint, Path>> getConnectedWaypoints(Waypoint waypoint); public abstract List<Tuple<Waypoint, PathEdge>> getConnectedWaypoints(Waypoint waypoint);
/** /**
* Returns a list of Tuple<Waypoint, Path> of a specific type that are connected to the given waypoint. * Returns a list of Tuple<Waypoint, Path> of a specific type that are connected to the given waypoint.
...@@ -89,14 +91,14 @@ public interface WaypointModel { ...@@ -89,14 +91,14 @@ public interface WaypointModel {
* @param type * @param type
* @return * @return
*/ */
public abstract List<Tuple<Waypoint, Path>> getConnectedWaypoints(Waypoint waypoint, Class type); public abstract List<Tuple<Waypoint, PathEdge>> getConnectedWaypoints(Waypoint waypoint, Class type);
/** /**
* Returns all paths that are part of the waypoint model. * Returns all paths that are part of the waypoint model.
* *
* @return * @return
*/ */
public abstract Set<Path> getPaths(); public abstract Set<PathEdge> getPaths();
/** /**
* Returns the shortest path between the two given waypoints. * Returns the shortest path between the two given waypoints.
...@@ -105,7 +107,7 @@ public interface WaypointModel { ...@@ -105,7 +107,7 @@ public interface WaypointModel {
* @param end * @param end
* @return * @return
*/ */
public abstract List<Path> getShortestPath(Waypoint start, Waypoint end); public abstract List<PathEdge> getShortestPath(Waypoint start, Waypoint end);
/** /**
* Returns the total number of waypoints. * Returns the total number of waypoints.
...@@ -153,7 +155,7 @@ public interface WaypointModel { ...@@ -153,7 +155,7 @@ public interface WaypointModel {
/* /*
public abstract void setStrongWaypointStrategy(StrongWaypointStrategy strongWaypointStrategy); public abstract void setStrongWaypointStrategy(StrongWaypointStrategy strongWaypointStrategy);
*/ */
public DefaultWeightedEdgeRetrievableGraph<Waypoint, Path> getGraph(); public Graph<Waypoint, PathEdge> getGraph();
/** /**
* Indicates if this model is scaled to the required world coordinates. * Indicates if this model is scaled to the required world coordinates.
......
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
package de.tud.kom.p2psim.api.topology.waypoints; package de.tud.kom.p2psim.api.topology.waypoints;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
public interface WaypointModelListener { public interface WaypointModelListener {
public void addedPath(Path path); public void addedPath(PathEdge path);
public void addedWaypoint(Waypoint waypoint); public void addedWaypoint(Waypoint waypoint);
public void modifiedWaypoints(); public void modifiedWaypoints();
} }
...@@ -23,10 +23,10 @@ package de.tud.kom.p2psim.api.util.geo.maps; ...@@ -23,10 +23,10 @@ package de.tud.kom.p2psim.api.util.geo.maps;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import org.jgrapht.Graph;
import de.tud.kom.p2psim.api.topology.obstacles.Obstacle; import de.tud.kom.p2psim.api.topology.obstacles.Obstacle;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.DefaultWeightedEdgeRetrievableGraph; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tud.kom.p2psim.impl.util.geo.maps.MapChangeListener; import de.tud.kom.p2psim.impl.util.geo.maps.MapChangeListener;
...@@ -39,9 +39,8 @@ public interface Map { ...@@ -39,9 +39,8 @@ public interface Map {
* @return * @return
*/ */
public PositionVector getDimensions(); public PositionVector getDimensions();
// TODO: Extract required functionality public Graph<Waypoint, PathEdge> getGraph();
public DefaultWeightedEdgeRetrievableGraph<Waypoint, Path> getGraph();
public void addWaypoint(Waypoint waypoint); public void addWaypoint(Waypoint waypoint);
......
...@@ -24,9 +24,11 @@ import java.util.ArrayList; ...@@ -24,9 +24,11 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import org.jgrapht.graph.DefaultWeightedEdge;
import de.tud.kom.p2psim.api.topology.movement.SimLocationActuator; import de.tud.kom.p2psim.api.topology.movement.SimLocationActuator;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.WeakWaypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.WeakWaypoint;
import de.tud.kom.p2psim.impl.util.Either; import de.tud.kom.p2psim.impl.util.Either;
...@@ -114,7 +116,7 @@ public class ShortestPathWaypointMovement extends AbstractLocalMovementStrategy ...@@ -114,7 +116,7 @@ public class ShortestPathWaypointMovement extends AbstractLocalMovementStrategy
Waypoint closestWaypointToDestination = waypointModel Waypoint closestWaypointToDestination = waypointModel
.getClosestWaypoint(finalDestination, WeakWaypoint.class); .getClosestWaypoint(finalDestination, WeakWaypoint.class);
List<Path> shortestPath = waypointModel.getShortestPath( List<PathEdge> shortestPath = waypointModel.getShortestPath(
closestWaypointToCurrentPosition, closestWaypointToDestination); closestWaypointToCurrentPosition, closestWaypointToDestination);
List<Waypoint> waypointList = buildWaypointList( List<Waypoint> waypointList = buildWaypointList(
...@@ -133,13 +135,13 @@ public class ShortestPathWaypointMovement extends AbstractLocalMovementStrategy ...@@ -133,13 +135,13 @@ public class ShortestPathWaypointMovement extends AbstractLocalMovementStrategy
* @return * @return
*/ */
protected List<Waypoint> buildWaypointList(Waypoint start, protected List<Waypoint> buildWaypointList(Waypoint start,
List<Path> shortestPath) { List<PathEdge> shortestPath) {
List<Waypoint> waypointList = new ArrayList<Waypoint>(); List<Waypoint> waypointList = new ArrayList<Waypoint>();
Waypoint lastWaypoint = start; Waypoint lastWaypoint = start;
waypointList.add(start); waypointList.add(start);
for (Path p : shortestPath) { for (PathEdge p : shortestPath) {
lastWaypoint = p.getOtherEnd(lastWaypoint); lastWaypoint = p.getOtherEnd(lastWaypoint);
waypointList.add(lastWaypoint); waypointList.add(lastWaypoint);
} }
......
...@@ -36,7 +36,7 @@ import de.tud.kom.p2psim.api.topology.waypoints.WaypointModel; ...@@ -36,7 +36,7 @@ import de.tud.kom.p2psim.api.topology.waypoints.WaypointModel;
import de.tud.kom.p2psim.api.topology.waypoints.WaypointModelListener; import de.tud.kom.p2psim.api.topology.waypoints.WaypointModelListener;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector; import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.StrongWaypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.StrongWaypoint;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tudarmstadt.maki.simonstrator.api.Randoms; import de.tudarmstadt.maki.simonstrator.api.Randoms;
...@@ -137,7 +137,7 @@ public class StrongWaypointComponentVis extends JComponent ...@@ -137,7 +137,7 @@ public class StrongWaypointComponentVis extends JComponent
} }
@Override @Override
public void addedPath(Path path) { public void addedPath(PathEdge path) {
needsRedraw = true; needsRedraw = true;
} }
......
...@@ -35,12 +35,13 @@ import java.util.Set; ...@@ -35,12 +35,13 @@ import java.util.Set;
import javax.swing.JComponent; import javax.swing.JComponent;
import org.jgrapht.Graph;
import de.tud.kom.p2psim.api.topology.waypoints.WaypointModel; import de.tud.kom.p2psim.api.topology.waypoints.WaypointModel;
import de.tud.kom.p2psim.api.topology.waypoints.WaypointModelListener; import de.tud.kom.p2psim.api.topology.waypoints.WaypointModelListener;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector; import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.DefaultWeightedEdgeRetrievableGraph; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.WeakWaypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.WeakWaypoint;
import de.tudarmstadt.maki.simonstrator.api.Randoms; import de.tudarmstadt.maki.simonstrator.api.Randoms;
...@@ -125,11 +126,11 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode ...@@ -125,11 +126,11 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode
} }
protected void drawColoredGraph(Graphics2D g2) { protected void drawColoredGraph(Graphics2D g2) {
ArrayList<Path> usedWaypoints = new ArrayList<Path>(); ArrayList<PathEdge> usedWaypoints = new ArrayList<PathEdge>();
ArrayList<Waypoint> starts = new ArrayList<Waypoint>(); ArrayList<Waypoint> starts = new ArrayList<Waypoint>();
Collection<Waypoint> waypoints = model.getWaypoints(); Collection<Waypoint> waypoints = model.getWaypoints();
DefaultWeightedEdgeRetrievableGraph<Waypoint, Path> graph = model.getGraph(); Graph<Waypoint, PathEdge> graph = model.getGraph();
if (waypoints == null || waypoints.isEmpty() || graph == null) { if (waypoints == null || waypoints.isEmpty() || graph == null) {
throw new RuntimeException() { throw new RuntimeException() {
...@@ -141,13 +142,13 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode ...@@ -141,13 +142,13 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode
if (starts.contains(wp)) continue; if (starts.contains(wp)) continue;
starts.add(wp); starts.add(wp);
ArrayList<Path> workList = new ArrayList<Path>(); ArrayList<PathEdge> workList = new ArrayList<PathEdge>();
workList.addAll(graph.edgesOf(wp)); workList.addAll(graph.edgesOf(wp));
Color pathColor = getRandomColor(); Color pathColor = getRandomColor();
while (!workList.isEmpty()) { while (!workList.isEmpty()) {
Path p = workList.remove(0); PathEdge p = workList.remove(0);
Waypoint target = p.getTarget(); Waypoint target = p.getTarget();
starts.add(target); starts.add(target);
...@@ -173,8 +174,8 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode ...@@ -173,8 +174,8 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode
} }
} }
private boolean containsPath(ArrayList<Path> workList, Path p1) { private boolean containsPath(ArrayList<PathEdge> workList, PathEdge p1) {
for (Path p : workList) { for (PathEdge p : workList) {
if (p.equals(p1)) { if (p.equals(p1)) {
return true; return true;
} }
...@@ -187,7 +188,7 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode ...@@ -187,7 +188,7 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode
} }
protected void drawPaths(Graphics2D g2) { protected void drawPaths(Graphics2D g2) {
Set<Path> paths = model.getPaths(); Set<PathEdge> paths = model.getPaths();
if (paths.isEmpty()) { if (paths.isEmpty()) {
throw new RuntimeException() { throw new RuntimeException() {
...@@ -195,7 +196,7 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode ...@@ -195,7 +196,7 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode
}; };
} }
for (Path p : paths) { for (PathEdge p : paths) {
PositionVector sourcePos = p.getSource().getPosition(); PositionVector sourcePos = p.getSource().getPosition();
PositionVector targetPos = p.getTarget().getPosition(); PositionVector targetPos = p.getTarget().getPosition();
...@@ -227,7 +228,7 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode ...@@ -227,7 +228,7 @@ public class WeakWaypointComponentVis extends JComponent implements WaypointMode
} }
@Override @Override
public void addedPath(Path path) { public void addedPath(PathEdge path) {
needsRedraw = true; needsRedraw = true;
} }
......
...@@ -25,7 +25,9 @@ import java.util.Collection; ...@@ -25,7 +25,9 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.jgrapht.alg.DijkstraShortestPath; import org.jgrapht.Graph;
import org.jgrapht.GraphPath;
import org.jgrapht.alg.shortestpath.DijkstraShortestPath;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
...@@ -38,8 +40,7 @@ import de.tud.kom.p2psim.api.util.geo.maps.Map; ...@@ -38,8 +40,7 @@ import de.tud.kom.p2psim.api.util.geo.maps.Map;
import de.tud.kom.p2psim.impl.scenario.simcfg2.annotations.After; import de.tud.kom.p2psim.impl.scenario.simcfg2.annotations.After;
import de.tud.kom.p2psim.impl.scenario.simcfg2.annotations.Configure; import de.tud.kom.p2psim.impl.scenario.simcfg2.annotations.Configure;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.DefaultWeightedEdgeRetrievableGraph; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tud.kom.p2psim.impl.util.Tuple; import de.tud.kom.p2psim.impl.util.Tuple;
import de.tud.kom.p2psim.impl.util.geo.maps.MapChangeListener; import de.tud.kom.p2psim.impl.util.geo.maps.MapChangeListener;
...@@ -221,26 +222,26 @@ public abstract class AbstractWaypointModel implements WaypointModel { ...@@ -221,26 +222,26 @@ public abstract class AbstractWaypointModel implements WaypointModel {
} }
@Override @Override
public List<Tuple<Waypoint, Path>> getConnectedWaypoints(Waypoint waypoint) { public List<Tuple<Waypoint, PathEdge>> getConnectedWaypoints(Waypoint waypoint) {
return getConnectedWaypoints(waypoint, Waypoint.class); return getConnectedWaypoints(waypoint, Waypoint.class);
} }
@Override @Override
public List<Tuple<Waypoint, Path>> getConnectedWaypoints(Waypoint waypoint, public List<Tuple<Waypoint, PathEdge>> getConnectedWaypoints(Waypoint waypoint,
Class type) { Class type) {
Set<Path> paths = map.getGraph().edgesOf(waypoint); Set<PathEdge> paths = map.getGraph().edgesOf(waypoint);
ArrayList<Tuple<Waypoint, Path>> waypointsAndPaths = new ArrayList<Tuple<Waypoint, Path>>(); ArrayList<Tuple<Waypoint, PathEdge>> waypointsAndPaths = new ArrayList<Tuple<Waypoint, PathEdge>>();
for (Path p : paths) { for (PathEdge p : paths) {
Waypoint destinationWaypoint = null; Waypoint destinationWaypoint = null;
if (p.getSource().equals(waypoint)) if (map.getGraph().getEdgeSource(p).equals(waypoint))
destinationWaypoint = p.getTarget(); destinationWaypoint = map.getGraph().getEdgeTarget(p);
else if (p.getTarget().equals(waypoint)) else if (map.getGraph().getEdgeTarget(p).equals(waypoint))
destinationWaypoint = p.getSource(); destinationWaypoint = map.getGraph().getEdgeSource(p);
if (destinationWaypoint.getClass().equals(type)) if (destinationWaypoint.getClass().equals(type))
waypointsAndPaths.add(new Tuple<Waypoint, Path>( waypointsAndPaths.add(new Tuple<Waypoint, PathEdge>(
destinationWaypoint, p)); destinationWaypoint, p));
} }
...@@ -278,7 +279,7 @@ public abstract class AbstractWaypointModel implements WaypointModel { ...@@ -278,7 +279,7 @@ public abstract class AbstractWaypointModel implements WaypointModel {
} }
} }
private void notifyAddedPath(Path path) { private void notifyAddedPath(PathEdge path) {
for (WaypointModelListener l : listeners) { for (WaypointModelListener l : listeners) {
l.addedPath(path); l.addedPath(path);
} }
...@@ -302,19 +303,18 @@ public abstract class AbstractWaypointModel implements WaypointModel { ...@@ -302,19 +303,18 @@ public abstract class AbstractWaypointModel implements WaypointModel {
} }
@Override @Override
public Set<Path> getPaths() { public Set<PathEdge> getPaths() {
return map.getGraph().getAllEdges(); return map.getGraph().edgeSet();
} }
@Override @Override
public List<Path> getShortestPath(Waypoint start, Waypoint end) { public List<PathEdge> getShortestPath(Waypoint start, Waypoint end) {
DijkstraShortestPath<Waypoint, Path> dijkstrashortestpath = new DijkstraShortestPath<Waypoint, Path>( DijkstraShortestPath<Waypoint, PathEdge> dijkstrashortestpath = new DijkstraShortestPath<Waypoint, PathEdge>(map.getGraph());
map.getGraph(), start, end);
GraphPath gp = dijkstrashortestpath.getPath(start, end);
List<Path> paths = dijkstrashortestpath.getPathEdgeList();
return dijkstrashortestpath.getPath(start, end).getEdgeList();
return dijkstrashortestpath.getPathEdgeList();
} }
@Override @Override
...@@ -323,7 +323,7 @@ public abstract class AbstractWaypointModel implements WaypointModel { ...@@ -323,7 +323,7 @@ public abstract class AbstractWaypointModel implements WaypointModel {
} }
@Override @Override
public DefaultWeightedEdgeRetrievableGraph<Waypoint, Path> getGraph() { public Graph<Waypoint, PathEdge> getGraph() {
if (map == null) if (map == null)
return null; return null;
......
/*
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of PeerfactSim.KOM.
*
* PeerfactSim.KOM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* PeerfactSim.KOM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
*
*/
package de.tud.kom.p2psim.impl.topology.waypoints.graph;
import java.util.Set;
import java.util.WeakHashMap;
import org.jgrapht.EdgeFactory;
import org.jgrapht.graph.DefaultDirectedWeightedGraph;
/**
* The simple weighted edge retrievable graph caches the edges
* for later batch retrieval.
*
* It uses the WeakHashMap to avoid unintentional references to
* dead objects.
*
* @author Fabio Zöllner
* @version 1.0, 27.03.2012
* @param <V> Vertices
* @param <E> Edges
*/
public class DefaultDirectedWeightedEdgeRetrievableGraph<V, E> extends DefaultDirectedWeightedGraph<V, E> {
private WeakHashMap<E, Object> edgeMap = new WeakHashMap<E, Object>();
@SuppressWarnings("unchecked")
public DefaultDirectedWeightedEdgeRetrievableGraph(EdgeFactory edgefactory) {
super(edgefactory);
}
@SuppressWarnings("unchecked")
public DefaultDirectedWeightedEdgeRetrievableGraph(Class class1) {
super(class1);
}
public E addEdge(V v1, V v2) {
E e = getEdgeFactory().createEdge(v1, v2);
addEdge(v1, v2, e);
return e;
}
public boolean addEdge(V v1, V v2, E e) {
edgeMap.put(e, null);
return super.addEdge(v1, v2, e);
}
public Set<E> getAllEdges() {
return edgeMap.keySet();
}
}
/*
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of PeerfactSim.KOM.
*
* PeerfactSim.KOM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* PeerfactSim.KOM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
*
*/
package de.tud.kom.p2psim.impl.topology.waypoints.graph;
import java.util.Set;
import java.util.WeakHashMap;
import org.jgrapht.graph.SimpleWeightedGraph;
/**
* The simple weighted edge retrievable graph caches the edges
* for later batch retrieval.
*
* It uses the WeakHashMap to avoid unintentional references to
* dead objects.
*
* @author Fabio Zöllner
* @version 1.0, 27.03.2012
* @param <V> Vertices
* @param <E> Edges
*/
public class DefaultWeightedEdgeRetrievableGraph<V, E> extends SimpleWeightedGraph<V, E> {
private WeakHashMap<E, Object> edgeMap = new WeakHashMap<E, Object>();
@SuppressWarnings("unchecked")
public DefaultWeightedEdgeRetrievableGraph(Class<? extends E> edgeClass) {
super(edgeClass);
}
/**
* Add an edge to the graph by specifying the
* start and end vertex.
*/
public E addEdge(V v1, V v2) {
E e = getEdgeFactory().createEdge(v1, v2);
addEdge(v1, v2, e);
return e;
}
/**
* Add an edge to the graph by specifying the
* start and end vertex as well as the edge
* that is connecting the two.
*/
public boolean addEdge(V v1, V v2, E e) {
edgeMap.put(e, null);
return super.addEdge(v1, v2, e);
}
/**
* Returns the set of all edges in the graph.
*
* @return
*/
public Set<E> getAllEdges() {
return edgeMap.keySet();
}
}
...@@ -30,12 +30,12 @@ import org.jgrapht.graph.DefaultWeightedEdge; ...@@ -30,12 +30,12 @@ import org.jgrapht.graph.DefaultWeightedEdge;
* @author Fabio Zöllner * @author Fabio Zöllner
* @version 1.0, 27.03.2012 * @version 1.0, 27.03.2012
*/ */
public class Path extends DefaultWeightedEdge { public class PathEdge extends DefaultWeightedEdge {
private Waypoint source; private Waypoint source;
private Waypoint target; private Waypoint target;
private double weight = 1; private double weight = 1;
public Path(Waypoint source, Waypoint target) { public PathEdge(Waypoint source, Waypoint target) {
this.source = source; this.source = source;
this.target = target; this.target = target;
...@@ -73,7 +73,7 @@ public class Path extends DefaultWeightedEdge { ...@@ -73,7 +73,7 @@ public class Path extends DefaultWeightedEdge {
if (getClass() != obj.getClass()) if (getClass() != obj.getClass())
return false; return false;
Path other = (Path) obj; PathEdge other = (PathEdge) obj;
if (getWeight() != other.getWeight() || if (getWeight() != other.getWeight() ||
!source.equals(other.getSource()) || !source.equals(other.getSource()) ||
!target.equals(other.getTarget())) !target.equals(other.getTarget()))
......
/*
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of PeerfactSim.KOM.
*
* PeerfactSim.KOM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* PeerfactSim.KOM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PeerfactSim.KOM. If not, see <http://www.gnu.org/licenses/>.
*
*/
package de.tud.kom.p2psim.impl.topology.waypoints.graph;
import org.jgrapht.EdgeFactory;
/**
* Creates a simple Path from two given way points.
*
* @author Fabio Zöllner
* @version 1.0, 09.04.2012
*/
public class PathEdgeFactory implements EdgeFactory<Waypoint, Path> {
@Override
public Path createEdge(Waypoint sourceVertex, Waypoint targetVertex) {
// Path uses the distance as weight by default
Path path = new Path(sourceVertex, targetVertex);
return path;
}
}
...@@ -38,8 +38,6 @@ import java.util.Map; ...@@ -38,8 +38,6 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import javanet.staxutils.IndentingXMLStreamWriter;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
...@@ -54,6 +52,7 @@ import org.xml.sax.helpers.DefaultHandler; ...@@ -54,6 +52,7 @@ import org.xml.sax.helpers.DefaultHandler;
import de.tud.kom.p2psim.impl.util.toolkits.SAXToolkit; import de.tud.kom.p2psim.impl.util.toolkits.SAXToolkit;
import de.tudarmstadt.maki.simonstrator.api.Monitor; import de.tudarmstadt.maki.simonstrator.api.Monitor;
import de.tudarmstadt.maki.simonstrator.api.Monitor.Level; import de.tudarmstadt.maki.simonstrator.api.Monitor.Level;
import javanet.staxutils.IndentingXMLStreamWriter;
/** /**
* <p> * <p>
......
...@@ -37,7 +37,6 @@ import org.jgrapht.Graph; ...@@ -37,7 +37,6 @@ import org.jgrapht.Graph;
import org.jgrapht.GraphPath; import org.jgrapht.GraphPath;
import org.jgrapht.alg.connectivity.ConnectivityInspector; import org.jgrapht.alg.connectivity.ConnectivityInspector;
import org.jgrapht.alg.shortestpath.DijkstraShortestPath; import org.jgrapht.alg.shortestpath.DijkstraShortestPath;
import org.jgrapht.graph.DefaultWeightedEdge;
import org.jgrapht.graph.SimpleWeightedGraph; import org.jgrapht.graph.SimpleWeightedGraph;
import de.tud.kom.p2psim.api.scenario.ConfigurationException; import de.tud.kom.p2psim.api.scenario.ConfigurationException;
...@@ -46,9 +45,7 @@ import de.tud.kom.p2psim.api.util.geo.maps.Map; ...@@ -46,9 +45,7 @@ import de.tud.kom.p2psim.api.util.geo.maps.Map;
import de.tud.kom.p2psim.api.util.geo.maps.Way; import de.tud.kom.p2psim.api.util.geo.maps.Way;
import de.tud.kom.p2psim.impl.topology.obstacles.PolygonObstacle; import de.tud.kom.p2psim.impl.topology.obstacles.PolygonObstacle;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.DefaultWeightedEdgeRetrievableGraph; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdgeFactory;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tud.kom.p2psim.impl.util.Tuple; import de.tud.kom.p2psim.impl.util.Tuple;
import de.tud.kom.p2psim.impl.util.geo.maps.MapChangeListener.MapEvent; import de.tud.kom.p2psim.impl.util.geo.maps.MapChangeListener.MapEvent;
...@@ -56,9 +53,9 @@ import de.tud.kom.p2psim.impl.util.geo.maps.MapChangeListener.MapEvent; ...@@ -56,9 +53,9 @@ import de.tud.kom.p2psim.impl.util.geo.maps.MapChangeListener.MapEvent;
public abstract class AbstractMap implements Map { public abstract class AbstractMap implements Map {
private List<Obstacle> obstacles = Lists.newLinkedList(); private List<Obstacle> obstacles = Lists.newLinkedList();
private List<Path> paths = Lists.newLinkedList(); private List<PathEdge> paths = Lists.newLinkedList();
protected Graph<Waypoint, DefaultWeightedEdge> graph = new SimpleWeightedGraph<>(DefaultWeightedEdge.class); protected Graph<Waypoint, PathEdge> graph = new SimpleWeightedGraph<>(PathEdge.class);
private Multimap<Class, Waypoint> typeWaypointMap = ArrayListMultimap.create(); private Multimap<Class, Waypoint> typeWaypointMap = ArrayListMultimap.create();
...@@ -109,9 +106,9 @@ public abstract class AbstractMap implements Map { ...@@ -109,9 +106,9 @@ public abstract class AbstractMap implements Map {
} }
protected void buildGraph() { protected void buildGraph() {
graph = new SimpleWeightedGraph<>(DefaultWeightedEdge.class); graph = new SimpleWeightedGraph<>(PathEdge.class);
for (Path path : paths) { for (PathEdge path : paths) {
graph.addVertex(path.getSource()); graph.addVertex(path.getSource());
graph.addVertex(path.getTarget()); graph.addVertex(path.getTarget());
typeWaypointMap.put(path.getSource().getClass(), path.getSource()); typeWaypointMap.put(path.getSource().getClass(), path.getSource());
...@@ -125,12 +122,12 @@ public abstract class AbstractMap implements Map { ...@@ -125,12 +122,12 @@ public abstract class AbstractMap implements Map {
raiseMapChanged(new MapChangeListener.ObstacleEvent(obstacle)); raiseMapChanged(new MapChangeListener.ObstacleEvent(obstacle));
} }
public void addPath(Path path) { public void addPath(PathEdge path) {
paths.add(path); paths.add(path);
raiseMapChanged(new MapChangeListener.PathEvent(path)); raiseMapChanged(new MapChangeListener.PathEvent(path));
} }
public List<Path> getPaths() { public List<PathEdge> getPaths() {
return paths; return paths;
} }
...@@ -194,12 +191,11 @@ public abstract class AbstractMap implements Map { ...@@ -194,12 +191,11 @@ public abstract class AbstractMap implements Map {
} }
protected void createPath(Waypoint wp1, Waypoint wp2) { protected void createPath(Waypoint wp1, Waypoint wp2) {
Path path = new Path(wp1, wp2); PathEdge path = new PathEdge(wp1, wp2);
addPath(path); addPath(path);
} }
@SuppressWarnings("unchecked") public Graph<Waypoint, PathEdge> getGraph() {
public DefaultWeightedEdgeRetrievableGraph getGraph() {
return graph; return graph;
} }
...@@ -259,9 +255,9 @@ public abstract class AbstractMap implements Map { ...@@ -259,9 +255,9 @@ public abstract class AbstractMap implements Map {
return swapped[axis.ordinal()]; return swapped[axis.ordinal()];
} }
public List<Path> getShortestPath(Waypoint start, Waypoint end) { public List<PathEdge> getShortestPath(Waypoint start, Waypoint end) {
DijkstraShortestPath<Waypoint, Path> dijkstrashortestpath = new DijkstraShortestPath<Waypoint, Path>(graph); DijkstraShortestPath<Waypoint, PathEdge> dijkstrashortestpath = new DijkstraShortestPath<Waypoint, PathEdge>(graph);
GraphPath<Waypoint, Path> path = dijkstrashortestpath.getPath(start, end); GraphPath<Waypoint, PathEdge> path = dijkstrashortestpath.getPath(start, end);
return path.getEdgeList(); return path.getEdgeList();
} }
...@@ -321,8 +317,8 @@ public abstract class AbstractMap implements Map { ...@@ -321,8 +317,8 @@ public abstract class AbstractMap implements Map {
while (waypoints != null) { while (waypoints != null) {
//removeWaypoints(waypoints, WeakWaypoint.class); //removeWaypoints(waypoints, WeakWaypoint.class);
for (Waypoint w : waypoints) { for (Waypoint w : waypoints) {
Set<Path> edges = Sets.newHashSet(graph.edgesOf(w)); Set<PathEdge> edges = Sets.newHashSet(graph.edgesOf(w));
for (Path p : edges) { for (PathEdge p : edges) {
graph.removeEdge(p); graph.removeEdge(p);
} }
graph.removeVertex(w); graph.removeVertex(w);
...@@ -360,8 +356,8 @@ public abstract class AbstractMap implements Map { ...@@ -360,8 +356,8 @@ public abstract class AbstractMap implements Map {
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
//removeWaypoint(shortestDistancePair.getA()); //removeWaypoint(shortestDistancePair.getA());
Set<Path> edges = graph.outgoingEdgesOf(shortestDistancePair.getA()); Set<PathEdge> edges = graph.outgoingEdgesOf(shortestDistancePair.getA());
for (Path p : edges) { for (PathEdge p : edges) {
graph.removeEdge(p); graph.removeEdge(p);
} }
graph.removeVertex(shortestDistancePair.getA()); graph.removeVertex(shortestDistancePair.getA());
...@@ -420,7 +416,7 @@ public abstract class AbstractMap implements Map { ...@@ -420,7 +416,7 @@ public abstract class AbstractMap implements Map {
} }
private Queue<List<Waypoint>> getConnectedComponents() { private Queue<List<Waypoint>> getConnectedComponents() {
ConnectivityInspector ci = new ConnectivityInspector<Waypoint, Path>(getGraph()); ConnectivityInspector ci = new ConnectivityInspector<Waypoint, PathEdge>(getGraph());
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<Set<Waypoint>> connectedSets = ci.connectedSets(); List<Set<Waypoint>> connectedSets = ci.connectedSets();
......
...@@ -22,7 +22,7 @@ package de.tud.kom.p2psim.impl.util.geo.maps; ...@@ -22,7 +22,7 @@ package de.tud.kom.p2psim.impl.util.geo.maps;
import de.tud.kom.p2psim.api.topology.obstacles.Obstacle; import de.tud.kom.p2psim.api.topology.obstacles.Obstacle;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tud.kom.p2psim.impl.util.geo.maps.AbstractMap.Axis; import de.tud.kom.p2psim.impl.util.geo.maps.AbstractMap.Axis;
...@@ -45,11 +45,11 @@ public interface MapChangeListener { ...@@ -45,11 +45,11 @@ public interface MapChangeListener {
} }
public static class PathEvent implements MapEvent { public static class PathEvent implements MapEvent {
private Path path; private PathEdge path;
public PathEvent(Path changedPath) { public PathEvent(PathEdge changedPath) {
this.path = changedPath; this.path = changedPath;
} }
public Path getPath() { public PathEdge getPath() {
return path; return path;
} }
} }
......
...@@ -50,7 +50,7 @@ import de.tud.kom.p2psim.api.scenario.ConfigurationException; ...@@ -50,7 +50,7 @@ import de.tud.kom.p2psim.api.scenario.ConfigurationException;
import de.tud.kom.p2psim.impl.topology.obstacles.PolygonObstacle; import de.tud.kom.p2psim.impl.topology.obstacles.PolygonObstacle;
import de.tud.kom.p2psim.impl.topology.util.PositionVector; import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector; import de.tud.kom.p2psim.impl.topology.views.VisualizationTopologyView.VisualizationInjector;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Path; import de.tud.kom.p2psim.impl.topology.waypoints.graph.PathEdge;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.Waypoint;
import de.tud.kom.p2psim.impl.topology.waypoints.graph.WeakWaypoint; import de.tud.kom.p2psim.impl.topology.waypoints.graph.WeakWaypoint;
import de.tud.kom.p2psim.impl.util.geo.maps.AbstractMap; import de.tud.kom.p2psim.impl.util.geo.maps.AbstractMap;
...@@ -111,15 +111,15 @@ public class SVGMap extends AbstractMap { ...@@ -111,15 +111,15 @@ public class SVGMap extends AbstractMap {
private void resolveIntersections() { private void resolveIntersections() {
List<PositionVector> intersections = Lists.newLinkedList(); List<PositionVector> intersections = Lists.newLinkedList();
List<Path> worklist = Lists.newLinkedList(getPaths()); List<PathEdge> worklist = Lists.newLinkedList(getPaths());
Iterator<Path> iter = concurrentIterator(worklist); Iterator<PathEdge> iter = concurrentIterator(worklist);
while (iter.hasNext()) { while (iter.hasNext()) {
Path path = iter.next(); PathEdge path = iter.next();
Iterator<Path> compareIter = concurrentIterator(worklist); Iterator<PathEdge> compareIter = concurrentIterator(worklist);
while (compareIter.hasNext()) { while (compareIter.hasNext()) {
Path comparePath = compareIter.next(); PathEdge comparePath = compareIter.next();
// Prevent intersection comparison for the same path and // Prevent intersection comparison for the same path and
// connected paths // connected paths
...@@ -140,8 +140,8 @@ public class SVGMap extends AbstractMap { ...@@ -140,8 +140,8 @@ public class SVGMap extends AbstractMap {
PositionVector intersection = intersects(path, comparePath); PositionVector intersection = intersects(path, comparePath);
if (intersection != null) { if (intersection != null) {
Path[] splitPath1 = splitPath(path, intersection); PathEdge[] splitPath1 = splitPath(path, intersection);
Path[] splitPath2 = splitPath(comparePath, intersection); PathEdge[] splitPath2 = splitPath(comparePath, intersection);
// Prevent the creation of loops // Prevent the creation of loops
if (splitPath1[0].getSource().equals( if (splitPath1[0].getSource().equals(
...@@ -222,20 +222,20 @@ public class SVGMap extends AbstractMap { ...@@ -222,20 +222,20 @@ public class SVGMap extends AbstractMap {
}; };
} }
private Path[] splitPath(Path path, PositionVector intersectionPoint) { private PathEdge[] splitPath(PathEdge path, PositionVector intersectionPoint) {
Path[] paths = new Path[2]; PathEdge[] paths = new PathEdge[2];
Waypoint wp1 = path.getSource(); Waypoint wp1 = path.getSource();
Waypoint wp2 = path.getTarget(); Waypoint wp2 = path.getTarget();
Waypoint iwp = getWaypoint(intersectionPoint); Waypoint iwp = getWaypoint(intersectionPoint);
paths[0] = new Path(wp1, iwp); paths[0] = new PathEdge(wp1, iwp);
paths[1] = new Path(wp2, iwp); paths[1] = new PathEdge(wp2, iwp);
return paths; return paths;
} }
private PositionVector intersects(Path path1, Path path2) { private PositionVector intersects(PathEdge path1, PathEdge path2) {
LineIntersector inter = new RobustLineIntersector(); LineIntersector inter = new RobustLineIntersector();
inter.computeIntersection(path1.getSource().getPosition() inter.computeIntersection(path1.getSource().getPosition()
......
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