Hello,
I am trying to build some models for analyzing various job dispatching rules in production systems.
To begin with, I decided to apply well-known SPT (shortest processing time) rule to a Queue object in simple simulation model, as shown below.
The flowitems within this model has a label called 'p_time', indicating processing time.
The processing times are exponentially distributed with mean 20 seconds, and they are determined by OnCreation trigger of Source object.
Moreover, the colors RED, YELLOW, GREEN and BLUE means 'Very Long processing time', 'Long processing time', 'SHORT processing time' and 'VERY SHORT processing time', respectively.
In order to apply SPT rule to Queue object, the flowitems at Queue should be sorted by processing time, 'p_time' label. Thus, I use 'Sort by Expression' option for triggers of Queue.
My problem is as follows:
1) When I apply 'Sort by Expression' option to OnEntry trigger of Queue, the SPT rule works successfully, as shown in Figure 1, where flowitems with same color (similar processing times) are contiguous.
2) On the contrary, when I apply 'Sort by Expression' option to OnExit trigger of Queue, the SPT rule does not work at all, as shown in Figure 2.
Could you explain why I can not implement the dispatching rule by using OnExit trigger?
Associated model files are attached.
Thanks.
(Figure 1. Applying Sort by Expression to OnEntry trigger - Sorted)
(Figure 2. Applying Sort by Expression to OnExit trigger - Not Sorted)