question

Ali Asghar avatar image
0 Likes"
Ali Asghar asked Felix Möhlmann commented

Different Process time for different inter arrival time flow item

I want to develop a logic where I can have different process time for different flowitems that arrives in the model.


The source creates model based on uniform distribution(10,70), now I need my processor to process items based on this logic

1. If the interarrival time is >= 50 Process time is 50

2. If interarrival time >40, process time is 40

3. If interarrival time is <30 process time is 30


I am trying to use global table method but not able to develop it

FlexSim 19.0.0
processorsourcelogicinterarrival times
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

You can modify the code in the Inter-Arrivaltime field of the source to first determine the time value, then set the process time of the processor based on the generated value and only then return the value.

  1. /**Custom Code*/
  2. Object current = ownerobject(c);
  3.  
  4. double interTime = exponential(0, 10, getstream(current));
  5. Object processor = ...;
  6. if(interTime >= 50)
  7. {
  8.     getvarnode(processor, "cycletime") = 50;
  9. }
  10. else if(...)
  11. {
  12.     ...
  13. }
  14. else
  15. {
  16.     ...
  17. }
  18. return interTime;
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.