Class Break

java.lang.Object
org.opentrafficsim.road.gtu.lane.Break

public final class Break
extends java.lang.Object
Utility to make debugging on a specific GTU more convenient. There is a method on() for a GTU and for perception. Should neither be available within the context of a method that needs to be debugged, onSub() can be used in combination with onSuper() at a higher-level method with a GTU or perception. This class requires the user to set a break point in the method trigger().

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

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version 10 apr. 2017
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Method Summary

    Modifier and Type Method Description
    static void on​(GTU gtu, java.lang.String id, double time, boolean additionalCondition)  
    static void on​(GTU gtu, java.lang.String id, java.lang.String time, boolean additionalCondition)  
    static void on​(Perception<?> perception, java.lang.String id, double time, boolean additionalCondition)  
    static void on​(Perception<?> perception, java.lang.String id, java.lang.String time, boolean additionalCondition)  
    static void onSub()
    This method can be used if the context of a lower-level function does not contain the information on which to break.
    static void onSub​(boolean additionalCondition)
    This method can be used if the context of a lower-level function does not contain the information on which to break.
    static void onSuper​(GTU gtu, java.lang.String id, double time, boolean additionalCondition)
    Sets a break condition to true which is triggered by onSub() at a lower level where context is insufficient to determine the break condition.
    static void onSuper​(Perception<?> perception, java.lang.String id, double time, boolean additionalCondition)
    Sets a break condition to true which is triggered by onSub() at a lower level where context is insufficient to determine the break condition.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • onSuper

      public static void onSuper​(Perception<?> perception, java.lang.String id, double time, boolean additionalCondition)
      Sets a break condition to true which is triggered by onSub() at a lower level where context is insufficient to determine the break condition.
      Parameters:
      perception - Perception<?>; perception to obtain gtu from
      id - String; GTU id to break on
      time - double; time to break at (or after)
      additionalCondition - boolean; additional condition
    • onSuper

      public static void onSuper​(GTU gtu, java.lang.String id, double time, boolean additionalCondition)
      Sets a break condition to true which is triggered by onSub() at a lower level where context is insufficient to determine the break condition.
      Parameters:
      gtu - GTU; GTU
      id - String; GTU id to break on
      time - double; time to break at (or after)
      additionalCondition - boolean; additional condition
    • onSub

      public static void onSub()
      This method can be used if the context of a lower-level function does not contain the information on which to break. This method will only trigger a break if at a higher-level function where the context was sufficient, the break condition was set to true using onSuper().
    • onSub

      public static void onSub​(boolean additionalCondition)
      This method can be used if the context of a lower-level function does not contain the information on which to break. This method will only trigger a break if at a higher-level function where the context was sufficient, the break condition was set to true using onSuper().
      Parameters:
      additionalCondition - boolean; additional condition
    • on

      public static void on​(Perception<?> perception, java.lang.String id, java.lang.String time, boolean additionalCondition)
      Parameters:
      perception - Perception<?>; perception to obtain gtu from
      id - String; GTU id to break on
      time - String; time to break at (or after), in format ss, mm:ss or hh:mm:ss
      additionalCondition - boolean; additional condition
    • on

      public static void on​(Perception<?> perception, java.lang.String id, double time, boolean additionalCondition)
      Parameters:
      perception - Perception<?>; perception to obtain gtu from
      id - String; GTU id to break on
      time - double; time to break at (or after)
      additionalCondition - boolean; additional condition
    • on

      public static void on​(GTU gtu, java.lang.String id, java.lang.String time, boolean additionalCondition)
      Parameters:
      gtu - GTU; GTU
      id - String; GTU id to break on
      time - String; time to break at (or after), in format ss, mm:ss or hh:mm:ss
      additionalCondition - boolean; additional condition
    • on

      public static void on​(GTU gtu, java.lang.String id, double time, boolean additionalCondition)
      Parameters:
      gtu - GTU; GTU
      id - String; GTU id to break on
      time - double; time to break at (or after)
      additionalCondition - boolean; additional condition