Revision 190:5c529cff4df6

View differences:

misc/eclipse/GenerateInstance.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.probleminstance.generator.GenerateInstance"/>
11
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-env src/main/resources/d-environments/empty-bounded.xml -nagents 6 -radius 80 -seed 1011 -outfile src/main/resources/problems/empty-bounded.xml -showvis -verbose"/>
11
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-env src/main/resources/d-environments/101.xml -nagents 15 -radius 10 -seed 1011 -outfile src/main/resources/problems/101.xml -showvis -verbose"/>
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/Solver (experiment tuning).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"/>
5
</listAttribute>
6
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7
<listEntry value="4"/>
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.euclidtime3i.Solver"/>
11
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-method PP -problemfile /home/capino/projects/deconfliction/repo/experiments/iterative/instances/empty/88.xml cross_conflict.xml -timeout 5000 -maxtime 2500 -gridstep 100 -showvis -summary -grid 4"/>
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>
misc/eclipse/Solver (experiments).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"/>
5
</listAttribute>
6
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7
<listEntry value="4"/>
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.euclidtime3i.Solver"/>
11
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-method KDPMD -k  10 -problemfile ~/projects/deconfliction/repo/experiments/ksfo/instances/urbanC-bounded-r48-gs50/ -maxtime 2500 -gridstep 40 -grid 16 -summary -showvis"/>
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/probleminstance/VisUtil.java
1 1
package tt.jointeuclid2ni.probleminstance;
2 2

  
3 3
import cz.agents.alite.vis.VisManager;
4
import cz.agents.alite.vis.layer.common.BackgroundLayer;
4 5
import cz.agents.alite.vis.layer.common.ColorLayer;
5 6
import cz.agents.alite.vis.layer.common.VisInfoLayer;
7
import cz.agents.alite.vis.layer.terminal.ImageLayer;
6 8
import cz.agents.alite.vis.layer.toggle.KeyToggleLayer;
9

  
7 10
import org.jgrapht.Graph;
11

  
8 12
import tt.discrete.Trajectory;
9 13
import tt.euclid2i.Line;
10 14
import tt.euclid2i.Point;
......
18 22
import tt.vis.*;
19 23

  
20 24
import javax.vecmath.Point2d;
25

  
21 26
import java.awt.*;
27
import java.awt.image.BufferedImage;
28
import java.io.File;
22 29
import java.util.Collection;
23 30
import java.util.Collections;
24 31
import java.util.LinkedList;
......
28 35

  
29 36
    private static final int SINGLE_TRAJECTORY_COLOR_SHIFT = 32;
30 37
    private static int singleTrajectoryColorCounter = 0;
38
    
39
    public static void initVisualization(final EarliestArrivalProblem problem, String title, int timeParameterStep) {
40
    	initVisualization(problem, title, null, timeParameterStep);
41
    }
31 42

  
32
    public static void initVisualization(final EarliestArrivalProblem problem, String title, int timeParameterStep) {
43
    public static void initVisualization(final EarliestArrivalProblem problem, String title, File bgImageFile, int timeParameterStep) {
44
    	VisManager.registerLayer(ColorLayer.create(Color.WHITE));
45
    	
46
    	
47
    	BufferedImage img = null;
48
    	if (bgImageFile != null) {
49
    		img = ImageLayer.loadImage(bgImageFile);
50
    		java.awt.Rectangle bounds = new java.awt.Rectangle(img.getWidth(), img.getHeight());
51
    		VisManager.registerLayer(PictureLayer.create(img, bounds));
52
    	}
53
    	
33 54
        VisManager.setInitParam(title, 700, 700);
34
        VisManager.registerLayer(ColorLayer.create(Color.WHITE));
35 55
        VisManager.setSceneParam(new VisManager.SceneParams() {
36 56

  
37 57
            @Override
......
51 71
            public double getDefaultZoomFactor() {
52 72
                return 0.5;
53 73
            }
54

  
55 74
        });
56 75

  
57 76
        if (TimeParameterHolder.time == null) {
58 77
            TimeParameterHolder.time = new TimeParameter(timeParameterStep);
59 78
            VisManager.registerLayer(ParameterControlLayer.create(TimeParameterHolder.time));
60 79
        }
80
        
61 81

  
62 82
        VisManager.init();
83
        
63 84
    }
64 85

  
65 86
    public static void visualizeProblem(final EarliestArrivalProblem problem) {
......
72 93
                        return Collections.singleton(problem.getEnvironment().getBoundary());
73 94
                    }
74 95

  
75
                }, Color.RED, Color.GRAY
76
        ));
96
                }, Color.RED, null)
97
        );
77 98

  
78 99
//        VisManager.registerLayer(RegionsLayer.create(
79 100
//                new RegionsLayer.RegionsProvider() {
src/main/java/tt/jointeuclid2ni/probleminstance/generator/GenerateInstance.java
126 126
        }
127 127

  
128 128
        if (showVis) {
129
        	VisUtil.initVisualization(instance, "Generated Instance", 10);
129
        	VisUtil.initVisualization(instance, "Generated Instance", null, 10);
130 130
        	VisUtil.visualizeProblem(instance);
131 131
        	VisUtil.visualizeGraph(instance.getPlanningGraph(), null);
132 132
        }
src/main/java/tt/jointeuclid2ni/probleminstance/generator/TriangulationGenerator.java
50 50
        Collection<Region> obstacles = problem.getObstacles();
51 51

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

  
src/main/resources/problems/empty-bounded.xml
12 12
<agent>
13 13
<start>
14 14
<point>
15
<x>797</x>
16
<y>797</y>
15
<x>447</x>
16
<y>727</y>
17 17
</point>
18 18
</start>
19 19
<target>
20 20
<point>
21
<x>902</x>
22
<y>237</y>
21
<x>727</x>
22
<y>587</y>
23
</point>
24
</target>
25
<radius>80</radius>
26
<maxspeed>1</maxspeed>
27
</agent>
28
<agent>
29
<start>
30
<point>
31
<x>237</x>
32
<y>587</y>
33
</point>
34
</start>
35
<target>
36
<point>
37
<x>482</x>
38
<y>377</y>
39
</point>
40
</target>
41
<radius>80</radius>
42
<maxspeed>1</maxspeed>
43
</agent>
44
<agent>
45
<start>
46
<point>
47
<x>272</x>
48
<y>167</y>
49
</point>
50
</start>
51
<target>
52
<point>
53
<x>97</x>
54
<y>167</y>
23 55
</point>
24 56
</target>
25 57
<radius>80</radius>
......
29 61
<start>
30 62
<point>
31 63
<x>657</x>
32
<y>132</y>
64
<y>202</y>
33 65
</point>
34 66
</start>
35 67
<target>
36 68
<point>
37
<x>132</x>
38
<y>237</y>
69
<x>657</x>
70
<y>377</y>
39 71
</point>
40 72
</target>
41 73
<radius>80</radius>
......
44 76
<agent>
45 77
<start>
46 78
<point>
47
<x>412</x>
48
<y>587</y>
79
<x>272</x>
80
<y>377</y>
49 81
</point>
50 82
</start>
51 83
<target>
52 84
<point>
53
<x>587</x>
54
<y>517</y>
85
<x>97</x>
86
<y>412</y>
55 87
</point>
56 88
</target>
57 89
<radius>80</radius>
......
60 92
<agent>
61 93
<start>
62 94
<point>
63
<x>377</x>
64
<y>412</y>
95
<x>307</x>
96
<y>902</y>
65 97
</point>
66 98
</start>
67 99
<target>
68 100
<point>
69
<x>167</x>
70
<y>587</y>
71
</point>
72
</target>
73
<radius>80</radius>
74
<maxspeed>1</maxspeed>
75
</agent>
76
<agent>
77
<start>
78
<point>
79
<x>762</x>
80
<y>622</y>
81
</point>
82
</start>
83
<target>
84
<point>
85
<x>167</x>
101
<x>657</x>
86 102
<y>797</y>
87 103
</point>
88 104
</target>
......
92 108
<agent>
93 109
<start>
94 110
<point>
95
<x>377</x>
96
<y>797</y>
111
<x>902</x>
112
<y>377</y>
97 113
</point>
98 114
</start>
99 115
<target>
100 116
<point>
101
<x>447</x>
102
<y>202</y>
117
<x>832</x>
118
<y>797</y>
119
</point>
120
</target>
121
<radius>80</radius>
122
<maxspeed>1</maxspeed>
123
</agent>
124
<agent>
125
<start>
126
<point>
127
<x>97</x>
128
<y>902</y>
129
</point>
130
</start>
131
<target>
132
<point>
133
<x>97</x>
134
<y>727</y>
103 135
</point>
104 136
</target>
105 137
<radius>80</radius>

Also available in: Unified diff