Revision 122:eb40cf245500

View differences:

misc/eclipse/Solver (test).launch
8 8
</listAttribute>
9 9
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
10 10
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="tt.jointeuclid2ni.Solver"/>
11
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-method PP -problemfile src/main/resources/problems/symmetric_obstacles.xml -maxtime 3500 -gridstep 25 -grid 8 -summary -showvis"/>
11
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-method PP -problemfile src/main/resources/environments/78_obstacles.xml -maxtime 3500 -summary -showvis"/>
12 12
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="deconflictiontools"/>
13 13
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
14 14
</launchConfiguration>
misc/eclipse/TriangulationGenerator.launch
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
3
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4
<listEntry value="/deconflictiontools/src/main/java/tt/jointeuclid2ni/probleminstance/generator/TriangulationGenerator.java"/>
5
</listAttribute>
6
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7
<listEntry value="1"/>
8
</listAttribute>
9
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
10
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="tt.jointeuclid2ni.probleminstance.generator.TriangulationGenerator"/>
11
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-problemfile /home/capino/projects/deconfliction/3rdparty/mrs2dplan/maps/78_obstacles.xml -dispersion 30 -bodyradius 8 -showvis -outfile out.xml"/>
12
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="deconflictiontools"/>
13
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
14
</launchConfiguration>
src/main/java/tt/jointeuclid2ni/SIPPDebug.java
1 1
package tt.jointeuclid2ni;
2 2

  
3 3

  
4
import java.util.Arrays;
5
import java.util.Collection;
6
import java.util.Collections;
7

  
4 8
import tt.euclid2i.Point;
5 9
import tt.euclid2i.Region;
6 10
import tt.euclid2i.discretization.LazyGrid;
......
14 18
import tt.jointeuclid2ni.solver.ObjectiveType;
15 19
import tt.jointeuclid2ni.solver.Parameters;
16 20

  
17
import java.util.Arrays;
18
import java.util.Collection;
19
import java.util.Collections;
20

  
21 21
public class SIPPDebug {
22 22
    public static void main(String[] args) throws ProblemNotCreatedException {
23 23

  
src/main/java/tt/jointeuclid2ni/Solver.java
9 9
import tt.jointeuclid2ni.probleminstance.EarliestArrivalProblemSimpleMissionDeserializer;
10 10
import tt.jointeuclid2ni.probleminstance.EarliestArrivalProblemXMLDeserializer;
11 11
import tt.jointeuclid2ni.solver.Algorithms;
12
import tt.jointeuclid2ni.solver.GraphType;
12 13
import tt.jointeuclid2ni.solver.HeuristicType;
13 14
import tt.jointeuclid2ni.solver.ObjectiveType;
14 15
import tt.jointeuclid2ni.solver.Parameters;
......
46 47
        String gridStepStr = Args.getArgumentValue(args, "-gridstep", false);
47 48
        String gridPatternStr = Args.getArgumentValue(args, "-grid", false);
48 49

  
50
        String roadmapStr = Args.getArgumentValue(args, "-roadmap", false);
51

  
49 52
        String heuristicStr = Args.getArgumentValue(args, "-heuristic", false, "PERFECT");
50 53
        params.heuristic = HeuristicType.valueOf(heuristicStr);
51 54

  
......
81 84

  
82 85
        params.maxTime = Integer.parseInt(maxtimeStr);
83 86
        if (gridStepStr != null) {
87
            params.graphType = GraphType.GRID;
84 88
            params.gridStep = Integer.parseInt(gridStepStr);
85 89
        }
86 90

  
91
        if (roadmapStr != null) {
92
            String[] parts = roadmapStr.split("/");
93
            if (parts.length != 2) {
94
                 throw new RuntimeException("Invalid roadmap specifier " + roadmapStr + ". Expecting 'D/R', where D is the dispersion between the samples in the roadmap and R is the connection radius.");
95
            }
96
            params.graphType = GraphType.ROADMAP;
97
            params.roadmapDispersion = Integer.parseInt(parts[0]);
98
            params.roadmapConnectionRadius = Integer.parseInt(parts[1]);
99
        }
100

  
87 101
        params.waitMoveDuration = params.gridStep;
88 102

  
89 103
        if (gridPatternStr != null) {
......
137 151
        System.out.println();
138 152
        System.out.println("  -gridstep: specifies the step of the grid-discretization used in the trajectory planning routines");
139 153
        System.out.println();
154
        System.out.println("  -roadmap: parameters of a roadmap for planning in the form 'N/R'");
155
        System.out.println("            where N is the number of samples and R is the connection radius");
156
        System.out.println();
140 157
        System.out.println("  -heuristic: specifies the heuristic used during trajectory planning. Currently supported: L1, L2, PERFECT");
141 158
        System.out.println();
142 159
        System.out.println("  -timeout: specifies the runtime limit for the solver in miliseconds");
src/main/java/tt/jointeuclid2ni/probleminstance/DejviceProblemRandom.java
1 1
package tt.jointeuclid2ni.probleminstance;
2 2

  
3 3

  
4
import java.util.Collection;
5
import java.util.List;
6
import java.util.Random;
7

  
4 8
import tt.euclid2i.Point;
5 9
import tt.euclid2i.Region;
6 10
import tt.euclid2i.probleminstance.Environment;
......
8 12
import tt.euclid2i.util.Util;
9 13
import tt.vis.environentcreator.PolygonParser;
10 14

  
11
import java.util.Collection;
12
import java.util.List;
13
import java.util.Random;
14

  
15 15
public class DejviceProblemRandom extends EarliestArrivalProblemImpl {
16 16

  
17 17
    private static final String OBSTACLE_FILE = "src/main/resources/problems/dejvice_precise.txt";
......
31 31
            public Rectangle getBounds() {
32 32
                return new Rectangle(new Point(0, 0), new Point(1000, 1000));
33 33
            }
34

  
34 35
        }, nAgents);
35 36

  
36 37
        random = new Random(seed);
src/main/java/tt/jointeuclid2ni/probleminstance/EarliestArrivalProblem.java
1 1
package tt.jointeuclid2ni.probleminstance;
2 2

  
3
import java.util.Collection;
4

  
5
import org.jgrapht.DirectedGraph;
6

  
7
import tt.euclid2i.Line;
3 8
import tt.euclid2i.Point;
4 9
import tt.euclid2i.Region;
5 10
import tt.euclid2i.probleminstance.Environment;
6 11
import tt.euclid2i.region.Rectangle;
7 12

  
8
import java.util.Collection;
9

  
10 13
public interface EarliestArrivalProblem {
11 14

  
12 15
    public int nAgents();
......
32 35
    public Rectangle getBounds();
33 36

  
34 37
    public Environment getEnvironment();
38

  
39
    public DirectedGraph<Point, Line> getPlanningGraph();
40

  
35 41
}
36 42

  
src/main/java/tt/jointeuclid2ni/probleminstance/EarliestArrivalProblemImpl.java
1 1
package tt.jointeuclid2ni.probleminstance;
2 2

  
3
import java.util.Arrays;
4
import java.util.Collection;
5

  
6
import org.jgrapht.DirectedGraph;
7

  
8
import tt.euclid2i.Line;
3 9
import tt.euclid2i.Point;
4 10
import tt.euclid2i.Region;
5 11
import tt.euclid2i.probleminstance.Environment;
6 12
import tt.euclid2i.region.Rectangle;
7 13

  
8
import java.util.Arrays;
9
import java.util.Collection;
10

  
11 14
public class EarliestArrivalProblemImpl implements EarliestArrivalProblem {
12 15

  
13 16
    @SuppressWarnings("serial")
......
23 26
    protected int bodyRadiuses[];
24 27
    protected int maxSpeeds[];
25 28

  
26
    public EarliestArrivalProblemImpl(Environment environment, Point[] starts, Point[] targets, int[] bodyRadiuses) {
27
        this(environment, starts, targets, bodyRadiuses, getSpeedArray(starts.length, 1));
29
    private DirectedGraph<Point, Line> planningGraph;
30

  
31
    public EarliestArrivalProblemImpl(Environment environment, Point[] starts, Point[] targets, int[] bodyRadiuses, DirectedGraph<Point, Line> planningGraph) {
32
        this(environment, starts, targets, bodyRadiuses, getSpeedArray(starts.length, 1), planningGraph);
28 33
    }
29 34

  
30 35
    private static int[] getSpeedArray(int nAgents, int speed) {
......
33 38
        return speeds;
34 39
    }
35 40

  
36
    public EarliestArrivalProblemImpl(Environment environment, Point[] starts, Point[] targets, int[] bodyRadiuses, int[] maxSpeeds) {
41
    public EarliestArrivalProblemImpl(Environment environment, Point[] starts, Point[] targets, int[] bodyRadiuses, int[] maxSpeeds, DirectedGraph<Point, Line> planningGraph) {
37 42
        super();
38 43
        this.environment = environment;
39 44
        this.starts = starts;
40 45
        this.targets = targets;
41 46
        this.bodyRadiuses = bodyRadiuses;
42 47
        this.maxSpeeds = maxSpeeds;
48
        this.planningGraph = planningGraph;
43 49

  
44 50
        if (starts.length == targets.length && targets.length == bodyRadiuses.length)
45 51
            nAgents = starts.length;
......
81 87
        return true;
82 88
    }
83 89

  
90
    @Override
84 91
    public int nAgents() {
85 92
        return starts.length;
86 93
    }
87 94

  
95
    @Override
88 96
    public Point getStart(int i) {
89 97
        return starts[i];
90 98
    }
91 99

  
100
    @Override
92 101
    public Point[] getStarts() {
93 102
        return starts;
94 103
    }
95 104

  
105
    @Override
96 106
    public Point getTarget(int i) {
97 107
        return targets[i];
98 108
    }
99 109

  
110
    @Override
100 111
    public tt.euclid2i.Point[] getTargets() {
101 112
        return targets;
102 113
    }
103 114

  
115
    @Override
104 116
    public int getBodyRadius(int i) {
105 117
        return bodyRadiuses[i];
106 118
    }
107 119

  
120
    @Override
108 121
    public int[] getBodyRadiuses() {
109 122
        return bodyRadiuses;
110 123
    }
111 124

  
125
    @Override
112 126
    public int getMaxSpeed(int i) {
113 127
        return maxSpeeds[i];
114 128
    }
115 129

  
130
    @Override
116 131
    public int[] getMaxSpeeds() {
117 132
        return maxSpeeds;
118 133
    }
119 134

  
135
    @Override
120 136
    public Collection<Region> getObstacles() {
121 137
        return environment.getObstacles();
122 138
    }
123 139

  
140
    @Override
124 141
    public Rectangle getBounds() {
125 142
        return environment.getBounds();
126 143
    }
127 144

  
145
    @Override
128 146
    public Environment getEnvironment() {
129 147
        return environment;
130 148
    }
131 149

  
150
    @Override
151
    public DirectedGraph<Point, Line> getPlanningGraph() {
152
        return planningGraph;
153
    }
154

  
155

  
156

  
157

  
132 158
}
src/main/java/tt/jointeuclid2ni/probleminstance/EarliestArrivalProblemSimpleMissionDeserializer.java
1 1
package tt.jointeuclid2ni.probleminstance;
2 2

  
3
import java.util.LinkedList;
4
import java.util.List;
5

  
3 6
import tt.euclid2i.Point;
4 7
import tt.euclid2i.probleminstance.Environment;
5 8

  
6
import java.util.LinkedList;
7
import java.util.List;
8

  
9 9
/**
10 10
 * Parses mission specification, i.e. start, destination and bodyRadius for each agent in a simple string format.
11 11
 * The expected format is:
......
68 68
            maxSpeeds[i] = agents.get(i).maxSpeed;
69 69
        }
70 70

  
71
        return new EarliestArrivalProblemImpl(env, starts, targets, bodyRadiuses, maxSpeeds);
71
        return new EarliestArrivalProblemImpl(env, starts, targets, bodyRadiuses, maxSpeeds, null);
72 72

  
73 73
    }
74 74
}
src/main/java/tt/jointeuclid2ni/probleminstance/EarliestArrivalProblemXMLConstants.java
7 7
    public static final String ENVIRONMENT = "environment";
8 8
    public static final String OBSTACLES = "obstacles";
9 9
    public static final String OBSTACLE = "obstacle";
10
    public static final String GRAPH = "graph";
11
    public static final String VERTICES = "vertices";
12
    public static final String EDGES = "edges";
13
    public static final String EDGE = "edge";
10 14
    public static final String POINT = "point";
11 15
    public static final String X = "x";
12 16
    public static final String Y = "y";
src/main/java/tt/jointeuclid2ni/probleminstance/EarliestArrivalProblemXMLDeserializer.java
9 9
import java.io.StringWriter;
10 10
import java.util.ArrayList;
11 11
import java.util.Collection;
12
import java.util.LinkedList;
12 13
import java.util.List;
13 14

  
14 15
import javax.xml.parsers.DocumentBuilder;
......
22 23
import javax.xml.transform.stream.StreamResult;
23 24

  
24 25
import org.apache.commons.lang3.ArrayUtils;
26
import org.jgrapht.DirectedGraph;
27
import org.jgrapht.EdgeFactory;
28
import org.jgrapht.graph.SimpleDirectedWeightedGraph;
25 29
import org.w3c.dom.Document;
26 30
import org.w3c.dom.Element;
27 31
import org.w3c.dom.Node;
28 32
import org.w3c.dom.NodeList;
29 33
import org.xml.sax.SAXException;
30 34

  
35
import tt.euclid2i.Line;
31 36
import tt.euclid2i.Point;
32 37
import tt.euclid2i.Region;
33 38
import tt.euclid2i.probleminstance.Environment;
......
44 49
        private List<Integer> radiuses;
45 50
        private List<Integer> maxSpeeds;
46 51

  
47

  
48 52
        private Agents() {
49 53
            this.size = 0;
50 54
            this.starts = new ArrayList<Point>();
......
60 64
            maxSpeeds.add(maxSpeed);
61 65
            size++;
62 66
        }
63

  
64 67
    }
65 68

  
66 69
    private Document doc;
......
88 91
    public EarliestArrivalProblem deserialize() {
89 92
        Environment environment = parseEnvironment();
90 93
        Agents agents = parseAgents();
94
        DirectedGraph<Point, Line> graph = parseGraph();
91 95

  
92 96
        Point[] starts = agents.starts.toArray(new Point[agents.size]);
93 97
        Point[] targets = agents.targets.toArray(new Point[agents.size]);
94 98
        int[] radiuses = ArrayUtils.toPrimitive(agents.radiuses.toArray(new Integer[agents.size]));
95 99
        int[] maxSpeeds = ArrayUtils.toPrimitive(agents.maxSpeeds.toArray(new Integer[agents.size]));
96 100

  
97
        return new EarliestArrivalProblemImpl(environment, starts, targets, radiuses, maxSpeeds);
101
        return new EarliestArrivalProblemImpl(environment, starts, targets, radiuses, maxSpeeds, graph);
102
    }
103

  
104
    private DirectedGraph<Point, Line> parseGraph() {
105
        DirectedGraph<Point, Line> graph = null;
106

  
107
        NodeList graphNL = doc.getElementsByTagName(EarliestArrivalProblemXMLConstants.GRAPH);
108

  
109
        if (graphNL.getLength() == 1) {
110

  
111
            graph = new SimpleDirectedWeightedGraph<Point, Line>(
112
                    new EdgeFactory<Point, Line>() {
113

  
114
                        @Override
115
                        public Line createEdge(Point sourceVertex,
116
                                Point targetVertex) {
117
                            return new Line(sourceVertex, targetVertex);
118
                        }
119

  
120
                    });
121

  
122
            NodeList verticesNL = doc.getElementsByTagName(EarliestArrivalProblemXMLConstants.VERTICES);
123
            assert verticesNL.getLength() == 1;
124
            NodeList pointNL = verticesNL.item(0).getChildNodes();
125
            for (int i = 0; i < pointNL.getLength(); i++) {
126
                if (pointNL.item(i).getNodeType() == Node.ELEMENT_NODE) {
127
                    Point point = parsePoint((Element) pointNL.item(i));
128
                    graph.addVertex(point);
129
                }
130
            }
131

  
132
            NodeList edgeNL = doc
133
                    .getElementsByTagName(EarliestArrivalProblemXMLConstants.EDGE);
134
            for (int i = 0; i < edgeNL.getLength(); i++) {
135
                if (edgeNL.item(i).getNodeType() == Node.ELEMENT_NODE) {
136
                    Element edgeElement = (Element) edgeNL.item(i);
137
                    NodeList edgePointNL = edgeElement.getChildNodes();
138

  
139
                    List<Point> points = new LinkedList<Point>();
140
                    for (int j=0; j<edgePointNL.getLength(); j++) {
141
                        if (edgePointNL.item(j).getNodeType() == Node.ELEMENT_NODE) {
142
                            points.add(parsePoint((Element) edgePointNL.item(j)));
143
                        }
144
                    }
145

  
146
                    assert points.size() == 2;
147

  
148
                    Point start = points.get(0);
149
                    Point end = points.get(1);
150
                    graph.addEdge(start, end);
151
                }
152
            }
153
            return graph;
154
        } else {
155
            return null;
156
        }
157

  
158

  
98 159
    }
99 160

  
100 161
    private Agents parseAgents() {
......
143 204
    }
144 205

  
145 206
    private Environment parseEnvironment() {
146
        final Rectangle bounds = parseBounds();
147 207

  
148 208
        NodeList obstacleElements = doc.getElementsByTagName(EarliestArrivalProblemXMLConstants.OBSTACLE);
149 209
        final List<Region> obstacles = parseObstacles(obstacleElements);
210
        Rectangle bounds = parseBounds();
211

  
212
        if (bounds == null) {
213
            bounds = computeBoundsAroundObstacles(obstacles);
214
        }
215

  
216
        final Rectangle boundsFinal = bounds;
150 217

  
151 218
        return new Environment() {
152 219
            @Override
......
156 223

  
157 224
            @Override
158 225
            public Rectangle getBounds() {
159
                return bounds;
226
                return boundsFinal;
160 227
            }
228

  
229

  
161 230
        };
162 231
    }
163 232

  
233
    private Rectangle computeBoundsAroundObstacles(List<Region> obstacles) {
234
        int minx = Integer.MAX_VALUE;
235
        int miny = Integer.MAX_VALUE;
236
        int maxx = Integer.MIN_VALUE;
237
        int maxy = Integer.MIN_VALUE;
238
        for (Region obstacle : obstacles) {
239
            Rectangle bbox = obstacle.getBoundingBox();
240
            minx = Math.min(minx, bbox.getCorner1().x);
241
            miny = Math.min(miny, bbox.getCorner1().y);
242
            maxx = Math.max(maxx, bbox.getCorner2().x);
243
            maxy = Math.max(maxy, bbox.getCorner2().y);
244
        }
245

  
246
        return new Rectangle(new Point(minx,miny), new Point(maxx,maxy));
247
    }
248

  
164 249
    private Rectangle parseBounds() {
165 250
        Element boundsElement = (Element) doc.getElementsByTagName(EarliestArrivalProblemXMLConstants.BOUNDS).item(0);
166 251
        if (boundsElement != null) {
......
175 260
                throw new RuntimeException("Error while parsing" + formatOutput(boundsElement));
176 261
            }
177 262
        } else {
178
            Rectangle defaultBounds = new Rectangle(
179
                    new Point(-100000, -100000),
180
                    new Point(100000, 100000));
181
            System.err.println("No bound provided, using default: " + defaultBounds);
182

  
183
            return defaultBounds;
263
            return null;
184 264
        }
185

  
186 265
    }
187 266

  
188 267
    private List<Region> parseObstacles(NodeList obstacleElements) {
src/main/java/tt/jointeuclid2ni/probleminstance/EarliestArrivalProblemXMLSerializer.java
1 1
package tt.jointeuclid2ni.probleminstance;
2 2

  
3
import org.w3c.dom.Document;
4
import org.w3c.dom.Element;
5
import org.w3c.dom.Node;
6
import tt.euclid2i.Point;
7
import tt.euclid2i.Region;
8
import tt.euclid2i.region.Polygon;
3
import java.io.File;
4
import java.io.FileNotFoundException;
5
import java.io.FileOutputStream;
6
import java.io.OutputStream;
9 7

  
10 8
import javax.xml.parsers.DocumentBuilder;
11 9
import javax.xml.parsers.DocumentBuilderFactory;
......
16 14
import javax.xml.transform.TransformerFactory;
17 15
import javax.xml.transform.dom.DOMSource;
18 16
import javax.xml.transform.stream.StreamResult;
19
import java.io.File;
20
import java.io.FileNotFoundException;
21
import java.io.FileOutputStream;
22
import java.io.OutputStream;
17

  
18
import org.jgrapht.DirectedGraph;
19
import org.w3c.dom.Document;
20
import org.w3c.dom.Element;
21
import org.w3c.dom.Node;
22

  
23
import tt.euclid2i.Line;
24
import tt.euclid2i.Point;
25
import tt.euclid2i.Region;
26
import tt.euclid2i.region.Polygon;
23 27

  
24 28

  
25 29
public class EarliestArrivalProblemXMLSerializer {
......
53 57
        // obstacles
54 58
        Element obstaclesElem = addElement(EarliestArrivalProblemXMLConstants.OBSTACLES, environmentElem);
55 59

  
60

  
56 61
        //int i = 0;
57 62
        for (Region region : problem.getObstacles()) {
58 63
            if (!(region instanceof Polygon)) {
......
75 80
        addPointElement(problem.getBounds().getCorner1(), boundsElem);
76 81
        addPointElement(problem.getBounds().getCorner2(), boundsElem);
77 82

  
83
        //graph
84
        DirectedGraph<Point, Line> graph = problem.getPlanningGraph();
85
        if (graph != null) {
86
            Element graphElem = addElement(EarliestArrivalProblemXMLConstants.GRAPH, problemElem);
87

  
88
            Element verticesElem = addElement(EarliestArrivalProblemXMLConstants.VERTICES, graphElem);
89
            for (Point vertex : graph.vertexSet()) {
90
                addPointElement(vertex, verticesElem);
91
            }
92

  
93
            Element edgesElem = addElement(EarliestArrivalProblemXMLConstants.EDGES, graphElem);
94

  
95
            for(Line line : graph.edgeSet()) {
96
                Element edgeElem = addElement(EarliestArrivalProblemXMLConstants.EDGE, edgesElem);
97
                addPointElement(line.getStart(), edgeElem);
98
                addPointElement(line.getEnd(),   edgeElem);
99
            }
100
        }
101

  
78 102
        // agents
79 103
        Element agentsElem = addElement(EarliestArrivalProblemXMLConstants.AGENTS, problemElem);
80 104

  
src/main/java/tt/jointeuclid2ni/probleminstance/NarrowPassageProblem.java
28 28
            public Rectangle getBounds() {
29 29
                return new Rectangle(new Point(0, 0), new Point(1000, 1000));
30 30
            }
31

  
31 32
        }, 2);
32 33

  
33 34
        generateMissions();
src/main/java/tt/jointeuclid2ni/probleminstance/SymetricObstacles.java
1 1
package tt.jointeuclid2ni.probleminstance;
2 2

  
3
import java.util.Collection;
4
import java.util.LinkedList;
5

  
3 6
import tt.euclid2i.Point;
4 7
import tt.euclid2i.Region;
5 8
import tt.euclid2i.probleminstance.Environment;
6 9
import tt.euclid2i.region.Rectangle;
7 10

  
8
import java.util.Collection;
9
import java.util.LinkedList;
10

  
11 11
public class SymetricObstacles extends EarliestArrivalProblemImpl {
12 12

  
13 13
    Environment env;
......
34 34
            public Rectangle getBounds() {
35 35
                return new Rectangle(new Point(0, 0), new Point(1000, 1000));
36 36
            }
37

  
37 38
        }, 2);
38 39

  
39 40
        generateMissions();
src/main/java/tt/jointeuclid2ni/probleminstance/SymmetricObstacles.java
1 1
package tt.jointeuclid2ni.probleminstance;
2 2

  
3
import java.util.Collection;
4
import java.util.LinkedList;
5

  
3 6
import tt.euclid2i.Point;
4 7
import tt.euclid2i.Region;
5 8
import tt.euclid2i.probleminstance.Environment;
6 9
import tt.euclid2i.region.Rectangle;
7 10

  
8
import java.util.Collection;
9
import java.util.LinkedList;
10

  
11 11
public class SymmetricObstacles extends EarliestArrivalProblemImpl {
12 12

  
13 13
    Environment env;
......
34 34
            public Rectangle getBounds() {
35 35
                return new Rectangle(new Point(0, 0), new Point(1000, 1000));
36 36
            }
37

  
37 38
        }, 2);
38 39

  
39 40
        generateMissions();
src/main/java/tt/jointeuclid2ni/probleminstance/VisUtil.java
1
package tt.jointeuclid2ni.probleminstance;
2

  
3
import java.awt.Color;
4
import java.util.Collection;
5
import java.util.LinkedList;
6

  
7
import javax.vecmath.Point2d;
8

  
9
import org.jgrapht.Graph;
10

  
11
import tt.euclid2i.Line;
12
import tt.euclid2i.Point;
13
import tt.euclid2i.Region;
14
import tt.euclid2i.region.Rectangle;
15
import tt.euclid2i.vis.RegionsLayer;
16
import tt.euclid2i.vis.RegionsLayer.RegionsProvider;
17
import tt.euclidtime3i.vis.TimeParameter;
18
import tt.util.AgentColors;
19
import tt.vis.GraphLayer;
20
import tt.vis.LabeledCircleLayer;
21
import tt.vis.ParameterControlLayer;
22
import tt.vis.TimeParameterHolder;
23
import cz.agents.alite.vis.VisManager;
24
import cz.agents.alite.vis.layer.common.ColorLayer;
25
import cz.agents.alite.vis.layer.common.VisInfoLayer;
26
import cz.agents.alite.vis.layer.toggle.KeyToggleLayer;
27

  
28
public class VisUtil {
29

  
30
    public static void initVisualization(final EarliestArrivalProblem problem, String title, int timeParameterStep) {
31
        VisManager.setInitParam(title, 700, 700);
32
        VisManager.setSceneParam(new VisManager.SceneParams() {
33

  
34
            @Override
35
            public Point2d getDefaultLookAt() {
36

  
37
                double x = problem.getEnvironment().getBounds().getCorner1().x
38
                        + ((problem.getEnvironment().getBounds().getCorner2().x - problem.getEnvironment().getBounds().getCorner1().x) / 2);
39
                double y = problem.getEnvironment().getBounds().getCorner1().y
40
                        + ((problem.getEnvironment().getBounds().getCorner2().y - problem.getEnvironment().getBounds().getCorner1().y) / 2);
41

  
42
                return new Point2d(x, y);
43
            }
44

  
45
            @Override
46
            public double getDefaultZoomFactor() {
47
                return 0.5;
48
            }
49

  
50
        });
51

  
52
        if (TimeParameterHolder.time == null) {
53
            TimeParameterHolder.time = new TimeParameter(timeParameterStep);
54
            VisManager.registerLayer(ParameterControlLayer.create(TimeParameterHolder.time));
55
        }
56

  
57
        VisManager.init();
58
    }
59

  
60
    public static void visualizeProblem(final EarliestArrivalProblem problem) {
61
        // background
62
        VisManager.registerLayer(ColorLayer.create(Color.WHITE));
63

  
64
        VisManager.registerLayer(RegionsLayer.create(
65
                new RegionsLayer.RegionsProvider() {
66

  
67
                    @Override
68
                    public Collection<Region> getRegions() {
69
                        LinkedList<Region> list = new LinkedList<Region>();
70
                        list.add(problem.getBounds());
71
                        return list;
72
                    }
73

  
74
                }, Color.LIGHT_GRAY, Color.WHITE));
75

  
76
        VisManager.registerLayer(RegionsLayer.create(
77
                new RegionsLayer.RegionsProvider() {
78

  
79
                    @Override
80
                    public Collection<Region> getRegions() {
81
                        LinkedList<Region> list = new LinkedList<Region>();
82
                        list.add(new Rectangle(new Point(0, 0), new Point(1000, 1000)));
83
                        return list;
84
                    }
85

  
86
                }, Color.GRAY));
87

  
88
        VisManager.registerLayer(RegionsLayer.create(
89
                new RegionsLayer.RegionsProvider() {
90

  
91
                    @Override
92
                    public Collection<Region> getRegions() {
93
                        return problem.getObstacles();
94
                    }
95

  
96
                }, Color.BLACK));
97

  
98
        VisManager.registerLayer(LabeledCircleLayer.create(new LabeledCircleLayer.LabeledCircleProvider<tt.euclid2i.Point>() {
99

  
100
            @Override
101
            public Collection<LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>> getLabeledCircles() {
102
                LinkedList<LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>> list = new LinkedList<LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>>();
103

  
104
                for (int i = 0; i < problem.getStarts().length; i++) {
105
                    list.add(new LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>(problem.getStart(i), problem.getBodyRadius(i), "s" + i, AgentColors.getColorForAgent(i)));
106
                }
107

  
108
                for (int i = 0; i < problem.getStarts().length; i++) {
109
                    list.add(new LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>(problem.getTarget(i), problem.getBodyRadius(i), "g" + i, AgentColors.getColorForAgent(i).darker().darker()));
110
                }
111

  
112
                return list;
113
            }
114

  
115
        }, new tt.euclid2i.vis.ProjectionTo2d()));
116

  
117
        // Overlay
118
        VisManager.registerLayer(VisInfoLayer.create());
119

  
120
    }
121

  
122
    public static void visualizeGraph(final Graph<Point, Line> graphToVisualize,
123
            final Collection<Region> inflatedObstacles) {
124

  
125
        KeyToggleLayer toggleLayer = KeyToggleLayer.create("g");
126
        toggleLayer.addSubLayer(
127
                GraphLayer.create(new GraphLayer.GraphProvider<tt.euclid2i.Point, Line>() {
128

  
129
                    @Override
130
                    public Graph<tt.euclid2i.Point, Line> getGraph() {
131
                        return graphToVisualize;
132
                    }
133
                }, new tt.euclid2i.vis.ProjectionTo2d(), Color.GRAY, Color.GRAY, 1, 4)
134
        );
135

  
136
        toggleLayer.addSubLayer(RegionsLayer.create(new RegionsProvider() {
137

  
138
            @Override
139
            public Collection<? extends Region> getRegions() {
140
                return inflatedObstacles;
141
            }
142
        }, Color.YELLOW));
143

  
144

  
145
        VisManager.registerLayer(toggleLayer);
146
        // create spatio-temporal graph
147
    }
148

  
149
}
src/main/java/tt/jointeuclid2ni/probleminstance/generator/TriangulationGenerator.java
1
package tt.jointeuclid2ni.probleminstance.generator;
2

  
3
import java.io.File;
4
import java.io.FileInputStream;
5
import java.io.FileNotFoundException;
6
import java.io.PrintStream;
7
import java.util.Collection;
8
import java.util.Collections;
9

  
10
import org.jgrapht.DirectedGraph;
11

  
12
import tt.euclid2i.Line;
13
import tt.euclid2i.Point;
14
import tt.euclid2i.Region;
15
import tt.euclid2i.region.Rectangle;
16
import tt.euclid2i.util.Util;
17
import tt.jointeuclid2ni.probleminstance.EarliestArrivalProblem;
18
import tt.jointeuclid2ni.probleminstance.EarliestArrivalProblemImpl;
19
import tt.jointeuclid2ni.probleminstance.EarliestArrivalProblemXMLDeserializer;
20
import tt.jointeuclid2ni.probleminstance.EarliestArrivalProblemXMLSerializer;
21
import tt.jointeuclid2ni.probleminstance.VisUtil;
22
import tt.util.Args;
23

  
24

  
25
public class TriangulationGenerator {
26

  
27
    public static void main(String[] args) throws FileNotFoundException {
28
        String xml = Args.getArgumentValue(args, "-problemfile", true);
29
        String outFile = Args.getArgumentValue(args, "-outfile", false);
30
        String dispersionStr = Args.getArgumentValue(args, "-dispersion", false);
31
        String connectionRadiusStr = Args.getArgumentValue(args, "-connectionradius", false);
32
        String bodyRadiusStr = Args.getArgumentValue(args, "-bodyradius", false);
33
        boolean showVis = Args.isArgumentSet(args, "-showvis");
34

  
35
        int dispersion = Integer.parseInt(dispersionStr);
36
        int bodyRadius = Integer.parseInt(bodyRadiusStr);
37
        int connectionRadius = Integer.parseInt(connectionRadiusStr);
38

  
39
        File file = new File(xml);
40
        EarliestArrivalProblem problem;
41

  
42
        problem = EarliestArrivalProblemXMLDeserializer.deserialize(new FileInputStream(file));
43

  
44
        Collection<Region> obstacles = problem.getObstacles();
45
        Rectangle bounds = problem.getBounds();
46

  
47
        Collection<Region> inflatedObstacles = Util.inflateRegions(obstacles, bodyRadius);
48
        Collection<Region> moreInflatedObstacles = Util.inflateRegions(obstacles, bodyRadius+1);
49

  
50
        DirectedGraph<Point, Line> planningGraph = Util.buildGridBasedRoadmap(inflatedObstacles, moreInflatedObstacles, bounds, dispersion, connectionRadius, Collections.<Point> emptyList());
51

  
52
        if (showVis) {
53
            VisUtil.initVisualization(problem, "Trajectory Tools Vis (triangulation generator)" , 10);
54
            VisUtil.visualizeProblem(problem);
55
            VisUtil.visualizeGraph(planningGraph, moreInflatedObstacles);
56
        }
57

  
58

  
59
        EarliestArrivalProblemImpl augmentedProblem = new EarliestArrivalProblemImpl(problem.getEnvironment(), problem.getStarts(), problem.getTargets(), problem.getBodyRadiuses(), problem.getMaxSpeeds(), planningGraph);
60

  
61
        PrintStream outStream = System.out;
62

  
63
        if (outFile != null) {
64
            outStream = new PrintStream(new File(outFile));
65
        }
66

  
67
        EarliestArrivalProblemXMLSerializer.serialize(augmentedProblem, outStream);
68

  
69
    }
70
}
src/main/java/tt/jointeuclid2ni/solver/GraphType.java
1
package tt.jointeuclid2ni.solver;
2

  
3
public enum GraphType {
4
    GRID, ROADMAP
5
}
src/main/java/tt/jointeuclid2ni/solver/Parameters.java
16 16
    public long startedAtMs;
17 17
    public long runtimeDeadlineMs;
18 18
    public int waitMoveDuration;
19
    public GraphType graphType;
19 20
    public int[][] gridPattern = LazyGrid.PATTERN_4_WAY;
20 21
    public HeuristicType heuristic;
21 22
    public ObjectiveType objective;
22 23
    public Algorithms selectedAlgorithm;
24

  
25
    public int roadmapDispersion;
26
    public int roadmapConnectionRadius;
23 27
}
src/main/java/tt/jointeuclid2ni/solver/impl/AbstractAlgorithm.java
3 3
import static tt.jointtraj.util.Util.getSumCost;
4 4

  
5 5
import java.awt.Color;
6
import java.util.Arrays;
6 7
import java.util.Collection;
7 8
import java.util.Collections;
9
import java.util.HashSet;
8 10
import java.util.LinkedList;
9

  
10
import javax.vecmath.Point2d;
11
import java.util.Set;
11 12

  
12 13
import org.jgrapht.DirectedGraph;
13
import org.jgrapht.Graph;
14 14

  
15 15
import tt.euclid2i.EvaluatedTrajectory;
16 16
import tt.euclid2i.Line;
......
21 21
import tt.euclid2i.discretization.LazyGrid;
22 22
import tt.euclid2i.region.Rectangle;
23 23
import tt.euclid2i.util.Util;
24
import tt.euclid2i.vis.RegionsLayer;
25
import tt.euclid2i.vis.RegionsLayer.RegionsProvider;
26 24
import tt.euclidtime3i.discretization.ConstantSpeedTimeExtension;
27 25
import tt.euclidtime3i.discretization.FreeOnTargetWaitExtension;
28 26
import tt.euclidtime3i.discretization.Straight;
29
import tt.euclidtime3i.vis.TimeParameter;
30 27
import tt.jointeuclid2ni.probleminstance.EarliestArrivalProblem;
28
import tt.jointeuclid2ni.probleminstance.VisUtil;
31 29
import tt.jointeuclid2ni.solver.Algorithm;
30
import tt.jointeuclid2ni.solver.GraphType;
32 31
import tt.jointeuclid2ni.solver.Parameters;
33 32
import tt.jointtraj.solver.SearchResult;
34 33
import tt.util.AgentColors;
35 34
import tt.util.Counters;
36 35
import tt.vis.FastAgentsLayer;
37 36
import tt.vis.FastTrajectoriesLayer;
38
import tt.vis.GraphLayer;
39
import tt.vis.LabeledCircleLayer;
40
import tt.vis.ParameterControlLayer;
41 37
import tt.vis.TimeParameterHolder;
42 38
import cz.agents.alite.vis.VisManager;
43
import cz.agents.alite.vis.layer.common.ColorLayer;
44
import cz.agents.alite.vis.layer.common.VisInfoLayer;
45
import cz.agents.alite.vis.layer.toggle.KeyToggleLayer;
46 39

  
47 40

  
48 41
public abstract class AbstractAlgorithm implements Algorithm {
......
58 51
        this.params = params;
59 52

  
60 53
        if (params.showVis) {
61
            initVisualization();
62
            visualizeProblem();
54
            VisUtil.initVisualization(problem, "Trajectory Tools Vis " + params.method,
55
                    (int) Math.round(((double) params.gridStep / (double) params.maxSpeed) / (double) 5));
56

  
57
            VisUtil.visualizeProblem(problem);
63 58
        }
64 59

  
65 60
        SearchResult result = solveProblem();
......
71 66
    }
72 67

  
73 68
    protected DirectedGraph<tt.euclidtime3i.Point, Straight> createMotionGraph(final DirectedGraph<tt.euclid2i.Point, Line> spatialGraph,
74
                                                                               final tt.euclid2i.Point init, final tt.euclid2i.Point goal, int maxSpeed, int maxTime) {
69
                                                                               final tt.euclid2i.Point init, final tt.euclid2i.Point goal,
70
                                                                               int maxSpeed, int maxTime) {
75 71

  
76 72
        // create spatio-temporal graph
77 73
        DirectedGraph<tt.euclidtime3i.Point, Straight> motions = new FreeOnTargetWaitExtension(
......
83 79
    protected DirectedGraph<tt.euclid2i.Point, Line> createAndShowGridForIthAgent(int i) {
84 80

  
85 81
        final Collection<Region> inflatedObstacles = Util.inflateRegions(problem.getObstacles(), problem.getBodyRadius(i));
82
        DirectedGraph<tt.euclid2i.Point, Line> spatialGraph = null;
83
        DirectedGraph<Point, Line> graphToVisualize = null;
86 84

  
87
        final DirectedGraph<tt.euclid2i.Point, Line> grid = new LazyGrid(
88
                problem.getStart(i),
89
                inflatedObstacles,
90
                problem.getBounds(),
91
                params.gridPattern,
92
                params.gridStep).generateFullGraph();
85
        if (problem.getPlanningGraph() != null) {
86
            DirectedGraph<Point, Line> commonGraph = problem.getPlanningGraph();
87
            // note that we do not clone the graph... this is intentional to save memory
88
            // all agents will share the same graph as a result
93 89

  
90
            Point start = problem.getStart(i);
91
            Point end = problem.getTarget(i);
94 92

  
95
        // create discretization
96
        final DirectedGraph<tt.euclid2i.Point, Line> spatialGraph
97
                = new AdditionalPointsExtension(grid, Collections.singleton(problem.getTarget(i)),
98
                params.gridStep, true);
93
            addVertexAndConnectToNeighbors(commonGraph, start, 4, inflatedObstacles);
94
            addVertexAndConnectToNeighbors(commonGraph, end, 4, inflatedObstacles);
99 95

  
100
        // graph
96
            spatialGraph = commonGraph;
97
            graphToVisualize = commonGraph;
101 98

  
102
        KeyToggleLayer toggleLayer = KeyToggleLayer.create("g");
103
        toggleLayer.addSubLayer(
104
                GraphLayer.create(new GraphLayer.GraphProvider<tt.euclid2i.Point, Line>() {
99
        } else if (params.graphType == GraphType.GRID) {
105 100

  
106
                    @Override
107
                    public Graph<tt.euclid2i.Point, Line> getGraph() {
108
                        return grid;
109
                    }
110
                }, new tt.euclid2i.vis.ProjectionTo2d(), Color.GRAY, Color.GRAY, 1, 4)
111
        );
101
            DirectedGraph<tt.euclid2i.Point, Line> grid = new LazyGrid(
102
                    problem.getStart(i),
103
                    inflatedObstacles,
104
                    problem.getBounds(),
105
                    params.gridPattern,
106
                    params.gridStep).generateFullGraph();
112 107

  
113
        toggleLayer.addSubLayer(RegionsLayer.create(new RegionsProvider() {
108
            graphToVisualize = grid;
114 109

  
115
            @Override
116
            public Collection<? extends Region> getRegions() {
117
                return inflatedObstacles;
118
            }
119
        }, Color.YELLOW));
110
            spatialGraph
111
                    = new AdditionalPointsExtension(grid, Collections.singleton(problem.getTarget(i)),
112
                    params.gridStep, true);
120 113

  
114
        } else if (params.graphType == GraphType.ROADMAP) {
121 115

  
122
        VisManager.registerLayer(toggleLayer);
123
        // create spatio-temporal graph
116
            Collection<Region> obstacles = problem.getObstacles();
117
            Rectangle bounds = problem.getBounds();
118
            Point start = problem.getStart(i);
119
            Point end = problem.getTarget(i);
120
            int dispersion = params.roadmapDispersion;
121
            int connectionRadius = params.roadmapConnectionRadius;
124 122

  
123
            final Collection<Region> moreInflatedObstacles = Util.inflateRegions(obstacles, problem.getBodyRadius(i)+1);
124

  
125
            spatialGraph = Util.buildGridBasedRoadmap(inflatedObstacles, moreInflatedObstacles, bounds,
126
                    dispersion, connectionRadius, Arrays.asList(new Point[] {start, end}));
127

  
128
            graphToVisualize = spatialGraph;
129
        }
130

  
131
        VisUtil.visualizeGraph(graphToVisualize, inflatedObstacles);
125 132

  
126 133
        return spatialGraph;
127 134
    }
128 135

  
129
    protected void initVisualization() {
130
        VisManager.setInitParam("Trajectory Tools Vis " + params.method, 700, 700);
131
        VisManager.setSceneParam(new VisManager.SceneParams() {
136
    private void addVertexAndConnectToNeighbors(DirectedGraph<Point, Line> graph, Point vertexToAdd, int n, Collection<Region> obstacles) {
132 137

  
133
            @Override
134
            public Point2d getDefaultLookAt() {
138
        Set<Point> otherVertices = new HashSet<Point>(graph.vertexSet());
139
        graph.addVertex(vertexToAdd);
135 140

  
136
                double x = problem.getEnvironment().getBounds().getCorner1().x
137
                        + ((problem.getEnvironment().getBounds().getCorner2().x - problem.getEnvironment().getBounds().getCorner1().x) / 2);
138
                double y = problem.getEnvironment().getBounds().getCorner1().y
139
                        + ((problem.getEnvironment().getBounds().getCorner2().y - problem.getEnvironment().getBounds().getCorner1().y) / 2);
140

  
141
                return new Point2d(x, y);
141
        for (int i=0; i < n; i++) {
142
            Point bestVertex = null;
143
            for (Point vertex : otherVertices) {
144
                if (bestVertex == null  || (bestVertex.distance(vertexToAdd) > vertex.distance(vertexToAdd)
145
                        && Util.isVisible(vertex, vertexToAdd, obstacles))
146
                    ) {
147
                    bestVertex = vertex;
148
                }
142 149
            }
143 150

  
144
            @Override
145
            public double getDefaultZoomFactor() {
146
                return 0.5;
147
            }
148

  
149
        });
150
        VisManager.init();
151
    }
152

  
153
    protected void visualizeProblem() {
154
        // background
155
        VisManager.registerLayer(ColorLayer.create(Color.WHITE));
156

  
157
        VisManager.registerLayer(RegionsLayer.create(
158
                new RegionsLayer.RegionsProvider() {
159

  
160
                    @Override
161
                    public Collection<Region> getRegions() {
162
                        LinkedList<Region> list = new LinkedList<Region>();
163
                        list.add(problem.getBounds());
164
                        return list;
165
                    }
166

  
167
                }, Color.LIGHT_GRAY, Color.WHITE));
168

  
169
        VisManager.registerLayer(RegionsLayer.create(
170
                new RegionsLayer.RegionsProvider() {
171

  
172
                    @Override
173
                    public Collection<Region> getRegions() {
174
                        LinkedList<Region> list = new LinkedList<Region>();
175
                        list.add(new Rectangle(new Point(0, 0), new Point(1000, 1000)));
176
                        return list;
177
                    }
178

  
179
                }, Color.GRAY));
180

  
181
        VisManager.registerLayer(RegionsLayer.create(
182
                new RegionsLayer.RegionsProvider() {
183

  
184
                    @Override
185
                    public Collection<Region> getRegions() {
186
                        return problem.getObstacles();
187
                    }
188

  
189
                }, Color.BLACK));
190

  
191
        VisManager.registerLayer(LabeledCircleLayer.create(new LabeledCircleLayer.LabeledCircleProvider<tt.euclid2i.Point>() {
192

  
193
            @Override
194
            public Collection<LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>> getLabeledCircles() {
195
                LinkedList<LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>> list = new LinkedList<LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>>();
196

  
197
                for (int i = 0; i < problem.getStarts().length; i++) {
198
                    list.add(new LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>(problem.getStart(i), problem.getBodyRadius(i), "s" + i, AgentColors.getColorForAgent(i)));
199
                }
200

  
201
                for (int i = 0; i < problem.getStarts().length; i++) {
202
                    list.add(new LabeledCircleLayer.LabeledCircle<tt.euclid2i.Point>(problem.getTarget(i), problem.getBodyRadius(i), "g" + i, AgentColors.getColorForAgent(i).darker().darker()));
203
                }
204

  
205
                return list;
206
            }
207

  
208
        }, new tt.euclid2i.vis.ProjectionTo2d()));
209

  
210
        // Overlay
211
        VisManager.registerLayer(VisInfoLayer.create());
212

  
213
        if (TimeParameterHolder.time == null) {
214
            TimeParameterHolder.time = new TimeParameter((int) Math.round(((double) params.gridStep / (double) params.maxSpeed) / (double) 5));
215
            VisManager.registerLayer(ParameterControlLayer.create(TimeParameterHolder.time));
151
            graph.addVertex(bestVertex);
152
            graph.addEdge(vertexToAdd, bestVertex);
153
            graph.addEdge(bestVertex, vertexToAdd);
154
            otherVertices.remove(bestVertex);
216 155
        }
217

  
218

  
219 156
    }
220 157

  
221 158
    protected void visualizeSolution(final SearchResult result) {
src/main/java/tt/vis/problemcreator/main/ExtensibleProblem.java
1 1
package tt.vis.problemcreator.main;
2 2

  
3
import java.util.ArrayList;
4
import java.util.Collection;
5
import java.util.List;
6

  
7
import org.jgrapht.DirectedGraph;
8

  
9
import tt.euclid2i.Line;
3 10
import tt.euclid2i.Point;
4 11
import tt.euclid2i.Region;
5 12
import tt.euclid2i.probleminstance.Environment;
......
8 15
import tt.jointeuclid2ni.probleminstance.AgentMissionImpl;
9 16
import tt.jointeuclid2ni.probleminstance.EarliestArrivalProblem;
10 17

  
11
import java.util.ArrayList;
12
import java.util.Collection;
13
import java.util.List;
14

  
15 18
public class ExtensibleProblem implements EarliestArrivalProblem {
16 19

  
17 20
    private List<Region> obstacles;
......
150 153
            public Rectangle getBounds() {
151 154
                return bounds;
152 155
            }
156

  
153 157
        };
154 158
    }
159

  
160
    @Override
161
    public DirectedGraph<Point, Line> getPlanningGraph() {
162
        return null;
163
    }
164

  
165

  
166

  
167

  
155 168
}
src/test/java/tt/jointeuclid2ni/sipp/SIPPWrapperTest.java
1 1
package tt.jointeuclid2ni.sipp;
2 2

  
3
import cz.agents.alite.vis.VisManager;
4
import cz.agents.alite.vis.layer.common.ColorLayer;
5
import cz.agents.alite.vis.layer.common.VisInfoLayer;
6
import cz.agents.alite.vis.layer.toggle.KeyToggleLayer;
3
import static org.junit.Assert.fail;
4

  
5
import java.awt.Color;
6
import java.io.PrintStream;
7
import java.util.Collection;
8
import java.util.Collections;
9
import java.util.LinkedList;
10
import java.util.List;
11

  
12
import javax.vecmath.Point2d;
13

  
7 14
import org.jgrapht.DirectedGraph;
8 15
import org.jgrapht.Graph;
9 16
import org.jgrapht.GraphPath;
......
13 20
import org.jgrapht.util.heuristics.ZeroHeuristic;
14 21
import org.junit.After;
15 22
import org.junit.Before;
16
import org.junit.Test;
17
import tt.euclid2i.*;
23

  
24
import tt.euclid2i.EvaluatedTrajectory;
25
import tt.euclid2i.Line;
18 26
import tt.euclid2i.Point;
27
import tt.euclid2i.Region;
28
import tt.euclid2i.Trajectory;
19 29
import tt.euclid2i.discretization.LazyGrid;
20 30
import tt.euclid2i.probleminstance.Environment;
21 31
import tt.euclid2i.probleminstance.RandomEnvironment;
......
34 44
import tt.jointeuclid2ni.probleminstance.generator.exception.ProblemNotCreatedException;
35 45
import tt.util.AgentColors;
36 46
import tt.util.Common;
37
import tt.vis.*;
38

  
39
import javax.vecmath.Point2d;
40
import java.awt.*;
41
import java.io.PrintStream;
42
import java.util.Collection;
43
import java.util.Collections;
44
import java.util.LinkedList;
45
import java.util.List;
46

  
47
import static org.junit.Assert.fail;
47
import tt.vis.ColoredTrajectoriesLayer;
48
import tt.vis.FastAgentsLayer;
49
import tt.vis.GraphLayer;
50
import tt.vis.LabeledPointLayer;
51
import tt.vis.ParameterControlLayer;
52
import cz.agents.alite.vis.VisManager;
53
import cz.agents.alite.vis.layer.common.ColorLayer;
54
import cz.agents.alite.vis.layer.common.VisInfoLayer;
55
import cz.agents.alite.vis.layer.toggle.KeyToggleLayer;
48 56

  
49 57
public class SIPPWrapperTest {
50 58

  
......
73 81
        //printStream.close();
74 82
    }
75 83

  
76
    @Test
84
    //@Test
77 85
    public void testAgainstPP() {
78 86
        for (int seed = 2; seed < 3; seed++) {
79 87
            try {

Also available in: Unified diff