Class AbstractLinkBasedGTU

java.lang.Object
All Implemented Interfaces:
java.io.Serializable, Locatable, EventProducerInterface, Identifiable, Drawable, GTU

public abstract class AbstractLinkBasedGTU
extends AbstractGTU

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-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 13, 2015
Author:
Alexander Verbraeck, Peter Knoppers
See Also:
Serialized Form
  • Constructor Details

    • AbstractLinkBasedGTU

      public AbstractLinkBasedGTU​(java.lang.String id, GTUType gtuType, OTSSimulatorInterface simulator, OTSNetwork network) throws GTUException
      Parameters:
      id - String; the id of the GTU
      gtuType - GTUType; the type of GTU, e.g. TruckType, CarType, BusType
      simulator - OTSSimulatorInterface; the simulator to schedule plan changes on
      network - OTSNetwork; the network in which this GTU is (initially) registered
      Throws:
      GTUException - when the construction of the original waiting path fails
  • Method Details

    • getNetwork

      public final OTSNetwork getNetwork()
      Returns:
      the network in which the GTU is registered
    • setNetwork

      public final void setNetwork​(OTSNetwork network)
      Parameters:
      network - OTSNetwork; change the network this GTU is registered in
    • getLink

      public abstract Link getLink()
      Return the link on which the REFERENCE position of the GTU currently is on. Returns null if the GTU is not on a link with its reference position.
      Returns:
      Link; the link on which the REFERENCE position of the GTU currently is on