Class 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 Detail

      • ContourPlotTest

        public ContourPlotTest()
    • Method Detail

      • setUp

        public final void setUp()
                         throws SimRuntimeException,
                                javax.naming.NamingException
        Code common to all contour plot tests.
        Throws:
        SimRuntimeException - if that happens uncaught; this test has failed
        javax.naming.NamingException - on error
      • 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,
                                                AbstractContourPlot<?> cp,
                                                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)