43.10 Time Horizon
Unfortunately, time horizons are not as easily handled in DES models as they are in Markov models. In Markov models, we know that the process will return to the health states after every cycle, so there is a clean point to check the termination condition to see if the process should stop. In DES models, there is no such clean point because the events in the model could happen after the time horizon should end. Therefore, if you want a fixed time horizon in your model, you need to explicitly add it to each time node.
The DES Tutorial Example model DES.Model.With.RepeatingEvents.trex accounts for the time horizon with an event that can occor off each time node. The time-to-event expression under the Time Horizon events must account for the total time of the model less time already passed for past events.
The time-to-event value is defined as: Time_HorizonExit = time_horizon - _time
where the parameter time_horizon = 20 and the keyword _time will change as the model is analysed. Once Time_HorizonExit becomes the smallest time-to-event, the model analysis will finish.