Package org.opentrafficsim.road.gtu
Class Break
java.lang.Object
org.opentrafficsim.road.gtu.Break
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-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidBreak on GTU and double time.static voidBreak on GTU and String of time.static voidon(Perception<?> perception, String id, double time, boolean additionalCondition) Break on perception and double time.static voidon(Perception<?> perception, String id, String time, boolean additionalCondition) Break on perception and String of time.static voidon(TacticalContextEgo context, String id, double time, boolean additionalCondition) Break on perception and double time.static voidonSub()This method can be used if the context of a lower-level function does not contain the information on which to break.static voidonSub(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 voidSets a break condition to true which is triggered byonSub()at a lower level where context is insufficient to determine the break condition.static voidonSuper(Perception<?> perception, String id, double time, boolean additionalCondition) Sets a break condition to true which is triggered byonSub()at a lower level where context is insufficient to determine the break condition.
-
Method Details
-
onSuper
public static void onSuper(Perception<?> perception, String id, double time, boolean additionalCondition) Sets a break condition to true which is triggered byonSub()at a lower level where context is insufficient to determine the break condition.- Parameters:
perception- perception to obtain gtu fromid- GTU id to break ontime- time to break at (or after)additionalCondition- additional condition
-
onSuper
Sets a break condition to true which is triggered byonSub()at a lower level where context is insufficient to determine the break condition.- Parameters:
gtu- GTUid- GTU id to break ontime- time to break at (or after)additionalCondition- 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 usingonSuper(). -
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 usingonSuper().- Parameters:
additionalCondition- additional condition
-
on
public static void on(Perception<?> perception, String id, String time, boolean additionalCondition) Break on perception and String of time.- Parameters:
perception- perception to obtain gtu fromid- GTU id to break ontime- time to break at (or after), in format ss, mm:ss or hh:mm:ssadditionalCondition- additional condition
-
on
public static void on(Perception<?> perception, String id, double time, boolean additionalCondition) Break on perception and double time.- Parameters:
perception- perception to obtain gtu fromid- GTU id to break ontime- time to break at (or after)additionalCondition- additional condition
-
on
public static void on(TacticalContextEgo context, String id, double time, boolean additionalCondition) Break on perception and double time.- Parameters:
context- tactical information such as parameters and car-following modelid- GTU id to break ontime- time to break at (or after)additionalCondition- additional condition
-
on
Break on GTU and String of time.- Parameters:
gtu- GTUid- GTU id to break ontime- time to break at (or after), in format ss, mm:ss or hh:mm:ssadditionalCondition- additional condition
-
on
Break on GTU and double time.- Parameters:
gtu- GTUid- GTU id to break ontime- time to break at (or after)additionalCondition- additional condition
-