Class ContourPlotTest

java.lang.Object
org.opentrafficsim.draw.graphs.ContourPlotTest
All Implemented Interfaces:
UNITS

public class ContourPlotTest
extends java.lang.Object
implements UNITS
Test the non-GUI part of the ContourPlot class.

Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

$LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, @version $Revision: 1401 $, by $Author: averbraeck $, initial version Aug 21, 2014

Author:
Peter Knoppers
  • Constructor Details

  • Method Details

    • setUp

      public final void setUp() throws SimRuntimeException
      Code common to all contour plot tests.
      Throws:
      SimRuntimeException - if that happens uncaught; this test has failed
    • accelerationContourTest

      public final void accelerationContourTest() throws java.lang.Exception
      Test the ContourPlotAcceleration.
      Throws:
      java.lang.Exception - when something goes wrong (should not happen)
    • densityContourTest

      public final void densityContourTest() throws java.lang.Exception
      Test the ContourPlotDensity.
      Throws:
      java.lang.Exception - when something goes wrong (should not happen)
    • flowContourTest

      public final void flowContourTest() throws java.lang.Exception
      Test the ContourPlotFlow.
      Throws:
      java.lang.Exception - when something goes wrong (should not happen)
    • speedContourTest

      public final void speedContourTest() throws java.lang.Exception
      Test the SpeedContourPlot.
      Throws:
      java.lang.Exception - when something goes wrong (should not happen)
    • standardContourTests

      public static void standardContourTests​(OTSSimulatorInterface simulator, org.opentrafficsim.draw.graphs.AbstractContourPlot<?> cp, org.opentrafficsim.draw.graphs.GraphPath<?> path, double expectedZValue, double expectedZValueWithTraffic) throws java.lang.Exception
      Test various properties of a ContourPlot that has no observed data added.
      Parameters:
      simulator - OTSSimulatorInterface; the simulator
      cp - AbstractContourPlot<?>; the ContourPlot to test
      path - GraphPath<?>; the path
      expectedZValue - double; the value that getZ and getZValue should return for a valid item when no car has passed
      expectedZValueWithTraffic - double; the value that getZ and getZValue should return a valid item where a car has traveled at constant speed of 50 km/h. Supply Double.NaN if the value varies but differs from the value expected when no car has passed
      Throws:
      java.lang.Exception - when something goes wrong (should not happen)
    • main

      public static void main​(java.lang.String[] args) throws java.lang.Exception
      Run the DensityContourPlot stand-alone for profiling.
      Parameters:
      args - String[]; the command line arguments (not used)
      Throws:
      java.lang.Exception - when something goes wrong (should not happen)