Class ContourPlotTest

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

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

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

Author:
Peter Knoppers
  • Method Details

    • setUp

      public void setUp() throws nl.tudelft.simulation.dsol.SimRuntimeException, NamingException
      Code common to all contour plot tests.
      Throws:
      nl.tudelft.simulation.dsol.SimRuntimeException - if that happens uncaught; this test has failed
      NamingException - on error
    • accelerationContourTest

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

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

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

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

      public static void standardContourTests(OtsSimulatorInterface simulator, AbstractContourPlot<?> cp, GraphPath<?> path, double expectedZValue, double expectedZValueWithTraffic) throws Exception
      Test various properties of a ContourPlot that has no observed data added.
      Parameters:
      simulator - the simulator
      cp - the ContourPlot to test
      path - the path
      expectedZValue - the value that getZ and getZValue should return for a valid item when no car has passed
      expectedZValueWithTraffic - 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:
      Exception - when something goes wrong (should not happen)
    • main

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