1 package org.opentrafficsim.draw.graphs;
2
3 import static org.junit.jupiter.api.Assertions.assertEquals;
4 import static org.junit.jupiter.api.Assertions.assertNull;
5 import static org.junit.jupiter.api.Assertions.assertTrue;
6 import static org.junit.jupiter.api.Assertions.fail;
7
8 import java.awt.event.ActionEvent;
9 import java.util.ArrayList;
10 import java.util.HashSet;
11 import java.util.LinkedHashSet;
12 import java.util.List;
13 import java.util.Set;
14
15 import javax.naming.NamingException;
16 import javax.swing.JOptionPane;
17
18 import org.djunits.unit.AccelerationUnit;
19 import org.djunits.unit.TimeUnit;
20 import org.djunits.unit.util.UNITS;
21 import org.djunits.value.vdouble.scalar.Acceleration;
22 import org.djunits.value.vdouble.scalar.Direction;
23 import org.djunits.value.vdouble.scalar.Duration;
24 import org.djunits.value.vdouble.scalar.Length;
25 import org.djunits.value.vdouble.scalar.Speed;
26 import org.djunits.value.vdouble.scalar.Time;
27 import org.djutils.draw.point.Point2d;
28 import org.djutils.immutablecollections.ImmutableArrayList;
29 import org.jfree.data.DomainOrder;
30 import org.junit.jupiter.api.Test;
31 import org.mockito.ArgumentMatchers;
32 import org.mockito.Mockito;
33 import org.mockito.invocation.InvocationOnMock;
34 import org.mockito.stubbing.Answer;
35 import org.opentrafficsim.animation.GraphLaneUtil;
36 import org.opentrafficsim.base.geometry.OtsGeometryException;
37 import org.opentrafficsim.core.definitions.DefaultsNl;
38 import org.opentrafficsim.core.dsol.OtsModelInterface;
39 import org.opentrafficsim.core.dsol.OtsReplication;
40 import org.opentrafficsim.core.dsol.OtsSimulatorInterface;
41 import org.opentrafficsim.core.gtu.GtuException;
42 import org.opentrafficsim.core.gtu.GtuType;
43 import org.opentrafficsim.core.network.NetworkException;
44 import org.opentrafficsim.core.network.Node;
45 import org.opentrafficsim.core.perception.HistoryManagerDevs;
46 import org.opentrafficsim.draw.graphs.GraphPath.Section;
47 import org.opentrafficsim.kpi.interfaces.LaneData;
48 import org.opentrafficsim.kpi.sampling.SamplerData;
49 import org.opentrafficsim.road.definitions.DefaultsRoadNl;
50 import org.opentrafficsim.road.gtu.lane.LaneBasedGtu;
51 import org.opentrafficsim.road.gtu.lane.tactical.LaneBasedCfLcTacticalPlanner;
52 import org.opentrafficsim.road.gtu.lane.tactical.following.FixedAccelerationModel;
53 import org.opentrafficsim.road.gtu.lane.tactical.following.GtuFollowingModelOld;
54 import org.opentrafficsim.road.gtu.lane.tactical.following.SequentialFixedAccelerationModel;
55 import org.opentrafficsim.road.gtu.lane.tactical.lanechangemobil.Egoistic;
56 import org.opentrafficsim.road.gtu.lane.tactical.lanechangemobil.LaneChangeModel;
57 import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlanner;
58 import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalRoutePlanner;
59 import org.opentrafficsim.road.network.RoadNetwork;
60 import org.opentrafficsim.road.network.factory.LaneFactory;
61 import org.opentrafficsim.road.network.lane.Lane;
62 import org.opentrafficsim.road.network.lane.LanePosition;
63 import org.opentrafficsim.road.network.lane.LaneType;
64 import org.opentrafficsim.road.network.sampling.LaneDataRoad;
65 import org.opentrafficsim.road.network.sampling.RoadSampler;
66
67 import nl.tudelft.simulation.dsol.SimRuntimeException;
68 import nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEvent;
69 import nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface;
70
71
72
73
74
75
76
77
78
79 public class ContourPlotTest implements UNITS
80 {
81
82
83 @SuppressWarnings("unchecked")
84 GraphPath<LaneData<?>> mockedPath = Mockito.mock(GraphPath.class);
85
86 Section<LaneData<?>> section0 = Mockito.mock(Section.class);
87
88 Section<LaneData<?>> section1 = Mockito.mock(Section.class);
89
90 LaneData<?> mockedLane0 = Mockito.mock(LaneData.class);
91
92 LaneData<?> mockedLane1 = Mockito.mock(LaneData.class);
93
94 SamplerData mockedSamplerData = Mockito.mock(SamplerData.class);
95
96 OtsSimulatorInterface mockedSimulator = Mockito.mock(OtsSimulatorInterface.class);
97
98 PlotScheduler mockedScheduler = Mockito.mock(PlotScheduler.class);
99
100 SimEventInterface<Duration> lastScheduledEvent = null;
101
102
103
104
105
106
107
108
109 private GraphPath<LaneDataRoad> dummyPath(final OtsSimulatorInterface simulator, final RoadNetwork network) throws Exception
110 {
111 LaneType laneType = DefaultsRoadNl.TWO_WAY_LANE;
112 Node b = new Node(network, "B", new Point2d(12345, 0), Direction.ZERO);
113 ArrayList<Lane> result = new ArrayList<Lane>();
114 Lane[] lanes = LaneFactory.makeMultiLane(network, "AtoB", new Node(network, "A", new Point2d(1234, 0), Direction.ZERO),
115 b, null, 1, laneType, new Speed(100, KM_PER_HOUR), simulator, DefaultsNl.VEHICLE);
116 result.add(lanes[0]);
117
118 lanes = LaneFactory.makeMultiLane(network, "BtoC", b, new Node(network, "C", new Point2d(99999, 0), Direction.ZERO),
119 null, 1, laneType, new Speed(100, KM_PER_HOUR), null, DefaultsNl.VEHICLE);
120 return GraphLaneUtil.createPath("AtoB", lanes[0]);
121 }
122
123
124
125
126
127
128 public final void setUp() throws SimRuntimeException, NamingException
129 {
130 Mockito.when(this.mockedPath.getTotalLength()).thenReturn(Length.valueOf("2000m"));
131 Mockito.when(this.mockedPath.getNumberOfSeries()).thenReturn(2);
132 Mockito.when(this.mockedPath.get(0)).thenReturn(this.section0);
133 Mockito.when(this.mockedPath.get(1)).thenReturn(this.section1);
134 Mockito.when(this.mockedPath.getStartDistance(this.section0)).thenReturn(Length.ZERO);
135 Mockito.when(this.mockedPath.getStartDistance(this.section1)).thenReturn(Length.valueOf("1234m"));
136 Mockito.when(this.mockedPath.getSpeedLimit()).thenReturn(Speed.valueOf("100 km/h"));
137 List<Section<LaneData<?>>> sectionList = new ArrayList<>();
138 sectionList.add(this.section0);
139 sectionList.add(this.section1);
140 Mockito.when(this.mockedLane0.getLength()).thenReturn(Length.valueOf("1234m"));
141 Mockito.when(this.mockedLane1.getLength()).thenReturn(Length.valueOf("766m"));
142 Set<LaneData<?>> set0 = new HashSet<>();
143 set0.add(this.mockedLane0);
144 Mockito.when(this.section0.iterator()).thenReturn(set0.iterator());
145 Set<LaneData<?>> set1 = new HashSet<>();
146 set1.add(this.mockedLane1);
147 Mockito.when(this.section0.iterator()).thenReturn(set0.iterator());
148 Mockito.when(this.section1.iterator()).thenReturn(set1.iterator());
149 Mockito.when(this.mockedPath.getSections()).thenReturn(new ImmutableArrayList<>(sectionList));
150 Mockito.when(this.section0.length()).thenReturn(Length.valueOf("2000m"));
151 Mockito.when(this.section1.length()).thenReturn(Length.valueOf("766m"));
152 Mockito.when(this.mockedSimulator.scheduleEventAbsTime(ArgumentMatchers.any(Time.class), ArgumentMatchers.any(),
153 ArgumentMatchers.anyString(), ArgumentMatchers.isNull())).thenAnswer(new Answer<SimEventInterface<Duration>>()
154 {
155 @Override
156 public SimEventInterface<Duration> answer(final InvocationOnMock invocation) throws Throwable
157 {
158 ContourPlotTest.this.lastScheduledEvent = new SimEvent<Duration>(
159 ((Time) invocation.getArgument(0)).minus(Time.ZERO), invocation.getArgument(2), "update", null);
160 return ContourPlotTest.this.lastScheduledEvent;
161 }
162 });
163 Mockito.when(this.mockedSimulator.getSimulatorAbsTime()).thenReturn(Time.ZERO);
164 Mockito.when(this.mockedSimulator.getSimulatorTime()).thenReturn(Duration.ZERO);
165 OtsModelInterface model = Mockito.mock(OtsModelInterface.class);
166 OtsReplication replication = new OtsReplication("test", Time.ZERO, Duration.ZERO, Duration.instantiateSI(3600.0),
167 HistoryManagerDevs.noHistory(this.mockedSimulator));
168 Mockito.when(this.mockedSimulator.getReplication()).thenReturn(replication);
169 Mockito.when(this.mockedScheduler.getTime()).thenReturn(Time.ZERO);
170 }
171
172
173
174
175
176 @Test
177 public final void accelerationContourTest() throws Exception
178 {
179 setUp();
180 ContourDataSource dataPool = new ContourDataSource(this.mockedSamplerData, this.mockedPath);
181 ContourPlotAcceleration acp = new ContourPlotAcceleration("acceleration", this.mockedScheduler, dataPool);
182 assertEquals("acceleration", acp.getSeriesKey(0), "SeriesKey should be \"acceleration\"");
183 standardContourTests(this.mockedSimulator, acp, this.mockedPath, Double.NaN, 0);
184 }
185
186
187
188
189
190 @Test
191 public final void densityContourTest() throws Exception
192 {
193 setUp();
194 OtsSimulatorInterface simulator = this.mockedSimulator;
195 RoadNetwork network = new RoadNetwork("density contour test network", simulator);
196 GraphPath<LaneDataRoad> path = dummyPath(simulator, network);
197 RoadSampler sampler = new RoadSampler(network);
198 ContourDataSource dataPool = new ContourDataSource(sampler.getSamplerData(), path);
199 ContourPlotDensity dcp = new ContourPlotDensity("density", this.mockedScheduler, dataPool);
200 assertTrue(null != dcp, "newly created DensityContourPlot should not be null");
201 assertEquals("density", dcp.getSeriesKey(0), "SeriesKey should be \"density\"");
202 standardContourTests(simulator, dcp, path, Double.NaN, Double.NaN);
203 }
204
205
206
207
208
209 @Test
210 public final void flowContourTest() throws Exception
211 {
212 setUp();
213 OtsSimulatorInterface simulator = this.mockedSimulator;
214 RoadNetwork network = new RoadNetwork("flow contour test network", simulator);
215 GraphPath<LaneDataRoad> path = dummyPath(simulator, network);
216 RoadSampler sampler = new RoadSampler(network);
217 ContourDataSource dataPool = new ContourDataSource(sampler.getSamplerData(), path);
218 ContourPlotFlow fcp = new ContourPlotFlow("flow", this.mockedScheduler, dataPool);
219 assertTrue(null != fcp, "newly created DensityContourPlot should not be null");
220 assertEquals("flow", fcp.getSeriesKey(0), "SeriesKey should be \"flow\"");
221 standardContourTests(simulator, fcp, path, Double.NaN, Double.NaN);
222 }
223
224
225
226
227
228 @Test
229 public final void speedContourTest() throws Exception
230 {
231 setUp();
232 OtsSimulatorInterface simulator = this.mockedSimulator;
233 RoadNetwork network = new RoadNetwork("flow contour test network", simulator);
234 GraphPath<LaneDataRoad> path = dummyPath(simulator, network);
235 RoadSampler sampler = new RoadSampler(network);
236 ContourDataSource dataPool = new ContourDataSource(sampler.getSamplerData(), path);
237 ContourPlotSpeed scp = new ContourPlotSpeed("speed", this.mockedScheduler, dataPool);
238 assertTrue(null != scp, "newly created DensityContourPlot should not be null");
239 assertEquals("speed", scp.getSeriesKey(0), "SeriesKey should be \"speed\"");
240 standardContourTests(simulator, scp, path, Double.NaN, 50);
241 }
242
243
244
245
246
247
248
249
250
251 static void printMatrix(final AbstractContourPlot<?> cp, final int fromX, final int toX, final int fromY, final int toY)
252 {
253 System.out.println("Contour plot data:");
254 int maxItem = cp.getItemCount(0);
255 for (int y = fromY; y <= toY; y++)
256 {
257 System.out.print(String.format("y=%3d ", y));
258 for (int x = fromX; x <= toX; x++)
259 {
260
261 int item;
262 for (item = 0; item < maxItem; item++)
263 {
264 if (cp.getXValue(0, item) == x && cp.getYValue(0, item) == y)
265 {
266 break;
267 }
268 }
269 if (item < maxItem)
270 {
271 System.out.print(String.format("%10.6f", cp.getZValue(0, item)));
272 }
273 else
274 {
275 System.out.print(" -------- ");
276 }
277 }
278 System.out.println("");
279 }
280 System.out.print("");
281 }
282
283
284
285
286
287
288
289
290
291
292
293
294 public static void standardContourTests(final OtsSimulatorInterface simulator, final AbstractContourPlot<?> cp,
295 final GraphPath<?> path, final double expectedZValue, final double expectedZValueWithTraffic) throws Exception
296 {
297 assertEquals(1, cp.getSeriesCount(), "seriesCount should be 1");
298 assertEquals(DomainOrder.ASCENDING, cp.getDomainOrder(), "domainOrder should be ASCENDING");
299 assertEquals(0, cp.indexOf(0), "indexOf always returns 0");
300 assertEquals(0, cp.indexOf("abc"), "indexOf always returns 0");
301 assertNull(cp.getGroup(), "getGroup always returns null");
302 int xBins = cp.getDataPool().timeAxis.getBinCount();
303 int yBins = cp.getDataPool().spaceAxis.getBinCount();
304 int expectedXBins = (int) Math.ceil(((AbstractPlot.DEFAULT_INITIAL_UPPER_TIME_BOUND).getSI())
305 / ContourDataSource.DEFAULT_TIME_GRANULARITIES[ContourDataSource.DEFAULT_TIME_GRANULARITY_INDEX]
306 + (cp.getDataPool().timeAxis.isInterpolate() ? 1 : 0));
307 assertEquals(expectedXBins, xBins, "Initial xBins should be " + expectedXBins);
308 int expectedYBins = (int) Math.ceil(path.getTotalLength().getSI()
309 / ContourDataSource.DEFAULT_SPACE_GRANULARITIES[ContourDataSource.DEFAULT_SPACE_GRANULARITY_INDEX]
310 + (cp.getDataPool().timeAxis.isInterpolate() ? 1 : 0));
311 assertEquals(expectedYBins, yBins, "yBins should be " + expectedYBins);
312 int bins = cp.getItemCount(0);
313 assertEquals(xBins * yBins, bins, "Total bin count is product of xBins * yBins");
314 String initialUpperTimeBoundString = AbstractPlot.DEFAULT_INITIAL_UPPER_TIME_BOUND.toString();
315
316 for (double timeGranularity : ContourDataSource.DEFAULT_TIME_GRANULARITIES)
317 {
318 cp.actionPerformed(new ActionEvent(timeGranularity, 0, "setTimeGranularity"));
319
320 for (double distanceGranularity : ContourDataSource.DEFAULT_SPACE_GRANULARITIES)
321 {
322 cp.actionPerformed(new ActionEvent(distanceGranularity, 0, "setSpaceGranularity"));
323 cp.notifyPlotChange();
324 expectedXBins = (int) Math.ceil((AbstractPlot.DEFAULT_INITIAL_UPPER_TIME_BOUND.getSI()) / timeGranularity)
325 + (cp.getDataPool().timeAxis.isInterpolate() ? 1 : 0);
326 xBins = cp.getDataPool().timeAxis.getBinCount();
327 assertEquals(expectedXBins, xBins, "Modified xBins should be " + expectedXBins);
328 expectedYBins = (int) Math.ceil(path.get(0).length().getSI() / distanceGranularity)
329 + (cp.getDataPool().spaceAxis.isInterpolate() ? 1 : 0);
330 yBins = cp.getDataPool().spaceAxis.getBinCount();
331
332
333
334 assertEquals(expectedYBins, yBins, "Modified yBins should be " + expectedYBins);
335 bins = cp.getItemCount(0);
336 assertEquals(xBins * yBins, bins, "Total bin count is product of xBins * yBins");
337 for (int item = 0; item < bins; item++)
338 {
339 double x = cp.getXValue(0, item);
340
341 assertTrue(x >= -timeGranularity / 2, "X should be >= -granularity / 2");
342 assertTrue(x <= AbstractPlot.DEFAULT_INITIAL_UPPER_TIME_BOUND.getSI(),
343 "X should be <= " + initialUpperTimeBoundString);
344 Number alternateX = cp.getX(0, item);
345 assertEquals(x, alternateX.doubleValue(), 0.000001,
346 "getXValue and getX should return things that have the same value");
347 double y = cp.getYValue(0, item);
348 Number alternateY = cp.getY(0, item);
349 assertEquals(y, alternateY.doubleValue(), 0.000001,
350 "getYValue and getY should return things that have the same value");
351 double z = cp.getZValue(0, item);
352 if (Double.isNaN(expectedZValue))
353 {
354 assertTrue(Double.isNaN(z), "Z value should be NaN");
355 }
356 else
357 {
358 assertEquals(expectedZValue, z, 0.0001, "Z value should be " + expectedZValue);
359 }
360 Number alternateZ = cp.getZ(0, item);
361 if (Double.isNaN(expectedZValue))
362 {
363 assertTrue(Double.isNaN(alternateZ.doubleValue()), "Alternate Z value should be NaN");
364 }
365 else
366 {
367 assertEquals(expectedZValue, alternateZ.doubleValue(), 0.0000,
368 "Alternate Z value should be " + expectedZValue);
369 }
370 }
371 try
372 {
373 cp.getXValue(0, -1);
374 fail("Should have thrown an Exception");
375 }
376 catch (RuntimeException e)
377 {
378
379 }
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407 }
408 }
409
410 try
411 {
412 cp.actionPerformed(new ActionEvent(cp, 0, "blabla"));
413 fail("Should have thrown an Exception");
414 }
415 catch (RuntimeException e)
416 {
417
418 }
419 try
420 {
421 cp.actionPerformed(new ActionEvent(cp, 0, "setDistanceGranularity -1"));
422 fail("Should have thrown an Exception");
423 }
424 catch (RuntimeException e)
425 {
426
427 }
428 try
429 {
430 cp.actionPerformed(new ActionEvent(cp, 0, "setDistanceGranularity abc"));
431 fail("Should have thrown an Exception");
432 }
433 catch (RuntimeException e)
434 {
435
436 }
437 try
438 {
439 cp.actionPerformed(new ActionEvent(cp, 0, "setDistanceGranularitIE 10"));
440 fail("Should have thrown an Exception");
441 }
442 catch (RuntimeException e)
443 {
444
445 }
446
447 final double useTimeGranularity = 30;
448 cp.actionPerformed(new ActionEvent(useTimeGranularity, 0, "setTimeGranularity"));
449 final double useDistanceGranularity =
450 ContourDataSource.DEFAULT_SPACE_GRANULARITIES[ContourDataSource.DEFAULT_SPACE_GRANULARITIES.length - 1];
451 cp.actionPerformed(new ActionEvent(useDistanceGranularity, 0, "setSpaceGranularity"));
452 cp.notifyPlotChange();
453 bins = cp.getItemCount(0);
454 Time initialTime = new Time(0, TimeUnit.BASE_SECOND);
455 Length initialPosition = new Length(100, METER);
456 Speed initialSpeed = new Speed(50, KM_PER_HOUR);
457
458 SequentialFixedAccelerationModel gtuFollowingModel =
459 new SequentialFixedAccelerationModel(simulator, new Acceleration(2.0, AccelerationUnit.METER_PER_SECOND_2));
460
461 gtuFollowingModel
462 .addStep(new FixedAccelerationModel(new Acceleration(0, METER_PER_SECOND_2), new Duration(60, SECOND)));
463
464 gtuFollowingModel
465 .addStep(new FixedAccelerationModel(new Acceleration(0, METER_PER_SECOND_2), new Duration(600, SECOND)));
466
467 gtuFollowingModel
468 .addStep(new FixedAccelerationModel(new Acceleration(0, METER_PER_SECOND_2), new Duration(300, SECOND)));
469 LaneChangeModel laneChangeModel = new Egoistic();
470
471
472 for (int item = 0; item < bins; item++)
473 {
474 double x = cp.getXValue(0, item);
475
476
477 assertTrue(x >= -cp.getTimeGranularity() / 2, "X should be >= -timeGranularity / 2");
478 assertTrue(x <= AbstractPlot.DEFAULT_INITIAL_UPPER_TIME_BOUND.si, "X should be <= " + initialUpperTimeBoundString);
479 Number alternateX = cp.getX(0, item);
480 assertEquals(x, alternateX.doubleValue(), 0.000001,
481 "getXValue and getX should return things that have the same value");
482 double y = cp.getYValue(0, item);
483 Number alternateY = cp.getY(0, item);
484 assertEquals(y, alternateY.doubleValue(), 0.000001,
485 "getYValue and getY should return things that have the same value");
486 double z = cp.getZValue(0, item);
487 if (Double.isNaN(expectedZValue))
488 {
489 assertTrue(Double.isNaN(z), "Z value should be NaN (got " + z + ")");
490 }
491 else
492 {
493 assertEquals(expectedZValue, z, 0.0001, "Z value should be " + expectedZValue);
494 }
495 Number alternateZ = cp.getZ(0, item);
496 if (Double.isNaN(expectedZValue))
497 {
498 assertTrue(Double.isNaN(alternateZ.doubleValue()), "Alternate Z value should be NaN");
499 }
500 else
501 {
502 assertEquals(expectedZValue, alternateZ.doubleValue(), 0.0000, "Alternate Z value should be " + expectedZValue);
503 }
504 }
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744 }
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763 private static LaneBasedGtu makeReferenceCar(final String id, final GtuType gtuType, final Lane lane,
764 final Length initialPosition, final Speed initialSpeed, final OtsSimulatorInterface simulator,
765 final GtuFollowingModelOld gtuFollowingModel, final LaneChangeModel laneChangeModel, final RoadNetwork network)
766 throws NamingException, NetworkException, SimRuntimeException, GtuException
767 {
768
769 Length length = new Length(5.0, METER);
770 Length width = new Length(2.0, METER);
771 Speed maxSpeed = new Speed(120, KM_PER_HOUR);
772 LaneBasedGtu gtu = new LaneBasedGtu(id, gtuType, length, width, maxSpeed, length.times(0.5), network);
773 LaneBasedStrategicalPlanner strategicalPlanner = new LaneBasedStrategicalRoutePlanner(
774 new LaneBasedCfLcTacticalPlanner(gtuFollowingModel, laneChangeModel, gtu), gtu);
775 gtu.init(strategicalPlanner, new LanePosition(lane, initialPosition), initialSpeed);
776
777 return gtu;
778 }
779
780
781
782
783
784
785 public static void main(final String[] args) throws Exception
786 {
787 ContourPlotTest cpt = new ContourPlotTest();
788 System.out.println("Click the OK button");
789 JOptionPane.showMessageDialog(null, "ContourPlot", "Start experiment", JOptionPane.INFORMATION_MESSAGE);
790 System.out.println("Running ...");
791 cpt.densityContourTest();
792 System.out.println("Finished");
793 }
794
795 }