Class ContourPlotTest

  • All Implemented Interfaces:
    UNITS

    public class ContourPlotTest
    extends 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 Detail

      • ContourPlotTest

        public ContourPlotTest()
    • Method Detail

      • accelerationContourTest

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

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

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

        public final 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 - 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:
        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 - String[]; the command line arguments (not used)
        Throws:
        Exception - when something goes wrong (should not happen)