question

Felix H avatar image
0 Likes"
Felix H asked Felix H commented

Making seperator process time average of 1000s regardless of batch size

Hi, I am trying to get a Seperator to determine the process time so that the queue content will be cleared in an average of 1000 seconds. I've tried to set the process time = 1000/ current.inObjects[1].stats.input.value, so that the total process time is 1000 seconds regardless of the batch size. This works fine for the first batch, however as the next batches arrives the input value of the current.inObject increases respectively, which again reduces the total process time for each batch.

So is there a better way to do this? I want the seperator to use an average of 1000 seconds on each batch regardless of the batch size. I figured that resetting the input stats on the current.inObject after each batch might work, but i dont know how to do that. In addition, the input stats might be of interest later on, so resetting stats might not be the best solution.

Thank you!

Seperator_Process_Time.fsm

FlexSim 18.0.10
global tableprocess timeflexsim 18.0.10seperatoraverage
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

tannerp avatar image
0 Likes"
tannerp answered Felix H commented

Hi @Felix H,

If you already know the outcome of your simulation (the separator takes 1000 seconds to process a batch), then what is it that you're measuring? This sounds like it could be solved using a math equation.

That said, what you're doing almost works, but I don't think it will be accurate since it's a dynamic value. I added a trigger that increments a "BatchSize" label on the queue. You can then use this to calculate the processing time. The "BatchSize" label is reset when the queue is empty. Let me know if this does what you expect it to do.

separator process time help.fsm


· 7
5 |100000

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

Felix H avatar image Felix H commented ·

Hi @tanner.p,

Thank you! The "BatchSize" label does exactly what I need. I dont know the outcome of the simulation yet. The seperator process time is just a minor, but important, part of a bigger model.

1 Like 1 ·
Felix H avatar image Felix H commented ·

Hi again @tanner.p,

I've implemented your BatchSize solution to my model and i thought it worked. But just now i got a clock overflow error and i dont know why. I tought maybe the error occurs because of the equation for process time at the seperator; "1000 / current.inObjects[1].BatchSize", and that when the BatchSize reaches 0 the equation is impossible. But i cant seem to get around it. Have you done anything in the model that i didnt notice? Or have you experienced this issue before?

Thank you in advance.

0 Likes 0 ·
tannerp avatar image tannerp Felix H commented ·

@Felix H, It's possible that the error could have occurred because the function tried to divide by 0. If you could post the model that's throwing the error, I'm happy to take a look at it. There's probably a more robust way of triggering changes on the "BatchSize" label than what I initially put, so I can look at that as well.

0 Likes 0 ·
Felix H avatar image Felix H tannerp commented ·

Hi @tanner.p,

I managed to fixed the problem. I accidentally used the wrong trigger on the seperator, where I used onEntry for the resetting command instead of OnProcessFinish. So the clock overflow error makes sence. Thank you anyways.

0 Likes 0 ·
Felix H avatar image Felix H commented ·

@tanner.p, do you know if its possible to use a decide activity in processflow to determine weither it is content on a queue with a spesific label or not? Let say i have 3 different items on the queue with 3 different destinations, is there a way to check if the queue contains an item with a spesific destination? It would be perfect if I can use current.subnodes.length but also add the spesific destination-label of the item.

0 Likes 0 ·
tannerp avatar image tannerp Felix H commented ·

@Felix H,

Yes, that is possible. You could do a loop using the Decide activity itself or you could use a Custom Code activity and create a loop within it. Essentially, you'd parse through each item and check its label value against the destination label that you are checking.

Example:

//Begin for loop or decide activity
for(int i = 1; i <= MyQueue.subnodes.length; i++)  {
  
  //Check if label exists on item for each i item
  if(MyQueue.subnodes[1].MyLabel == "MyDestination")  {
    return 1;
  }
  else  {
    return 0;
  }
}

Hopefully this helps!

0 Likes 0 ·
Felix H avatar image Felix H tannerp commented ·

It works perfect! Thank you again, @tanner.p.

1 Like 1 ·