Class CarTest

java.lang.Object
org.opentrafficsim.road.car.CarTest
All Implemented Interfaces:
UNITS

public class CarTest
extends java.lang.Object
implements UNITS

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

$LastChangedDate: 2015-09-16 19:20:07 +0200 (Wed, 16 Sep 2015) $, @version $Revision: 1405 $, by $Author: averbraeck $, initial version Jul 11, 2014

Author:
Peter Knoppers
  • Constructor Details

  • Method Details

    • carTest

      public final void carTest() throws NetworkException, SimRuntimeException, javax.naming.NamingException, GTUException, OTSGeometryException
      Test some basics of the Car class.
      Throws:
      NetworkException - on ???
      SimRuntimeException - on ???
      javax.naming.NamingException - on ???
      GTUException - on ???
      OTSGeometryException - when center line or contour of a link or lane cannot be generated
    • makeSimulator

      public static OTSSimulatorInterface makeSimulator() throws SimRuntimeException, javax.naming.NamingException
      Create the simplest possible simulator.
      Returns:
      DEVSSimulator.TimeDoubleUnit
      Throws:
      SimRuntimeException - on ???
      javax.naming.NamingException - on ???
    • makeReferenceCar

      public static org.opentrafficsim.road.gtu.lane.LaneBasedIndividualGTU makeReferenceCar​(java.lang.String id, GTUType gtuType, org.opentrafficsim.road.network.lane.Lane lane, Length initialPosition, Speed initialSpeed, OTSSimulatorInterface simulator, org.opentrafficsim.road.gtu.lane.tactical.following.GTUFollowingModelOld gtuFollowingModel, org.opentrafficsim.road.gtu.lane.tactical.lanechangemobil.LaneChangeModel laneChangeModel, org.opentrafficsim.road.network.OTSRoadNetwork network) throws javax.naming.NamingException, NetworkException, SimRuntimeException, GTUException, OTSGeometryException
      Create a new Car.
      Parameters:
      id - String; the name (number) of the Car
      gtuType - GTUType; the type of the new car
      lane - Lane; the lane on which the new Car is positioned
      initialPosition - Length; the initial longitudinal position of the new Car
      initialSpeed - Speed; the initial speed
      simulator - OTSDEVVSimulator; the simulator that controls the new Car (and supplies the initial value for getLastEvalutionTime())
      gtuFollowingModel - GTUFollowingModel; the GTU following model
      laneChangeModel - LaneChangeModel; the lane change model
      network - the network
      Returns:
      Car; the new Car
      Throws:
      javax.naming.NamingException - on network error when making the animation
      NetworkException - when the GTU cannot be placed on the given lane.
      SimRuntimeException - when the move method cannot be scheduled.
      GTUException - when construction of the GTU fails (probably due to an invalid parameter)
      OTSGeometryException - when the initial path is wrong
    • makeLane

      public static org.opentrafficsim.road.network.lane.Lane makeLane​(org.opentrafficsim.road.network.RoadNetwork network, org.opentrafficsim.road.network.lane.LaneType laneType, OTSSimulatorInterface simulator) throws NetworkException, OTSGeometryException
      Parameters:
      network - RoadNetwork; the network
      laneType - LaneType<String>; the type of the lane
      simulator - OTSSimulatorInterface; simulator
      Returns:
      a lane of 1000 m long.
      Throws:
      NetworkException - on network error
      OTSGeometryException - when center line or contour of a link or lane cannot be generated