Class DelayTable

All Implemented Interfaces:
NamedObjectOps
Direct Known Subclasses:
SchedDelayTable, StdDelayTable

public abstract class DelayTable extends MsgForwardingInfo
Base class for delay tables.
  • Constructor Details

    • DelayTable

      protected DelayTable(DramaSimulation sim, String name, boolean intern)
      Constructor.
      Parameters:
      sim - the simulation
      name - the name of this object
      intern - true if this object should be interned in the simulation's name table; false otherwise
  • Method Details

    • addToDomain

      public void addToDomain(HubDomain domain)
      Add this table to a hub domain.
      Parameters:
      domain - the hub domain
    • latestStartingTime

      public abstract double latestStartingTime(double time, Hub src, Hub dest)
      Get the latest starting time, given a minimum starting time, for a trip between two hubs with the same arrival time.
      Parameters:
      time - the time in seconds, measured from the start of the simulation, at which a trip from src to dest could start
      src - the starting hub
      dest - the ending hub
      Returns:
      the latest simulation time in seconds at which the trip could start without changing the arrival time; Double.NEGATIVE_INFINITY if a trip is not possible
      Throws:
      IllegalArgumentException - there was no entry in the delay table for src and dest for the specified time
    • latestStartingTime

      public double latestStartingTime(Hub src, Hub dest)
      Get the latest starting time at or after the current simulation time for a trip between two hubs assuming the same arrival time.
      Parameters:
      src - the starting hub
      dest - the ending hub
      Returns:
      the latest simulation time in seconds at which the trip could start without changing the arrival time; Double.NEGATIVE_INFINITY if a trip is not possible
    • estimateDelay

      public abstract double estimateDelay(double startingTime, Hub src, Hub dest, int n)
      Estimate the time it takes to travel between two hubs.
      Parameters:
      startingTime - the time in seconds, measured from the start of the simulation, at which a trip from src to dest starts
      src - the starting hub
      dest - the ending hub
      n - the number of individuals traveling together
      Returns:
      the time in seconds to travel from src to dest; Double.POSITIVE_INFINITY if the trip is not possible
      Throws:
      NullPointerException - if the second argument is null or the third argument is null;
    • estimateDelay

      public double estimateDelay(Hub src, Hub dest, int n)
      Estimate the time it takes to travel between two hubs, starting at the current simulation time.
      Parameters:
      src - the starting hub
      dest - the ending hub
      n - the number of individuals traveling together
      Returns:
      the time in seconds to travel from src to dest; Double.POSITIVE_INFINITY if the trip is not possible
      Throws:
      NullPointerException - if the first argument is null or the second argument is null;
    • getDelay

      public abstract double getDelay(double startingTime, Hub src, Hub dest, int n)
      Get the time it takes to travel between two hubs. test if a trip is possible.
      Parameters:
      startingTime - the time in seconds, measured from the start of the simulation, at which a trip from src to dest starts
      src - the starting hub
      dest - the ending hub
      n - the number of individuals traveling together
      Returns:
      the time in seconds to travel from src to dest; Double.POSITIVE_INFINITY if the trip is not possible
      Throws:
      NullPointerException - if the second argument is null or the third argument is null;
    • getDelay

      public double getDelay(Hub src, Hub dest, int n)
      Get the time it takes to travel between two hubs, starting at the current simulation time.
      Parameters:
      src - the starting hub
      dest - the ending hub
      n - the number of individuals traveling together
      Returns:
      the time in seconds to travel from src to dest; Double.POSITIVE_INFINITY if the trip is not possible
      Throws:
      NullPointerException - if the first argument is null or the second argument is null;
    • localDelay

      protected long localDelay(Domain domain, Actor src, Object msg, Actor dest)
      Overrides:
      localDelay in class GenericMsgFrwdngInfo<DramaSimulation,Actor,Condition,Domain,DomainMember,DramaFactory,Group>
    • clone

      protected Object clone() throws CloneNotSupportedException
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • isInterned

      public boolean isInterned()
      Specified by:
      isInterned in interface NamedObjectOps
    • getObjectNamer

      protected Simulation getObjectNamer()
    • getName

      public final String getName()
      Specified by:
      getName in interface NamedObjectOps
    • canDelete

      public boolean canDelete()
      Specified by:
      canDelete in interface NamedObjectOps
    • delete

      public final boolean delete()
      Specified by:
      delete in interface NamedObjectOps
    • isDeleted

      public final boolean isDeleted()
      Specified by:
      isDeleted in interface NamedObjectOps
    • deletePending

      public final boolean deletePending()
      Specified by:
      deletePending in interface NamedObjectOps