Revision 165:98303c8d2e5a

View differences:

src/main/java/tt/jointeuclid2ni/probleminstance/VisUtil.java
23 23
import java.util.Collections;
24 24
import java.util.LinkedList;
25 25

  
26

  
26 27
public class VisUtil {
27 28

  
29
    private static final int SINGLE_TRAJECTORY_COLOR_SHIFT = 32;
30
    private static int singleTrajectoryColorCounter = 0;
31

  
28 32
    public static void initVisualization(final EarliestArrivalProblem problem, String title, int timeParameterStep) {
29 33
        VisManager.setInitParam(title, 700, 700);
30 34
        VisManager.registerLayer(ColorLayer.create(Color.WHITE));
......
121 125
    public static void visualizeSingleTrajectory(Trajectory trajectory, int bodyRadius, int maxTime) {
122 126
        final Trajectory[] trajInArr = {trajectory};
123 127
        final int[] radInArr = {bodyRadius};
128
        final int color = SINGLE_TRAJECTORY_COLOR_SHIFT + singleTrajectoryColorCounter++;
124 129

  
125 130
        VisManager.registerLayer(ColoredTrajectoriesLayer.create(
126 131
                new ColoredTrajectoriesLayer.TrajectoriesProvider<Point>() {
......
131 136
                }, new ColoredTrajectoriesLayer.ColorProvider() {
132 137
                    @Override
133 138
                    public Color getColor(int i) {
134
                        return AgentColors.getColorForAgent(i);
139
                        return AgentColors.getColorForAgent(color);
135 140
                    }
136 141
                }, new tt.euclid2i.vis.ProjectionTo2d(), 5, maxTime, 6, 's'
137 142
        ));
......
151 156
                }, new FastAgentsLayer.ColorProvider() {
152 157
                    @Override
153 158
                    public Color getColor(int i) {
154
                        return AgentColors.getColorForAgent(i + 32);
159
                        return AgentColors.getColorForAgent(color);
155 160
                    }
156 161
                }, TimeParameterHolder.time
157 162
        ));

Also available in: Unified diff