question

Gulati avatar image
0 Likes"
Gulati asked Gulati commented

Regarding Batch

@jordan.johnson I attached a very simple model in which a batch of 100 items coming from source1 to queue1 and a lot size of 10 out of those 100 one by one going to processor to get process.i want as 80 items went from queue1 next batch of 100 must reach queue1 from source 1. is it possible to execute the situation with the help of custom code from entry, exit trigger of queue1 and exit trigger of source by assigning labels.practise-model.fsm

FlexSim 17.2.5
regarding batch
practise-model.fsm (16.4 KiB)
5 |100000

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

Jordan Johnson avatar image
4 Likes"
Jordan Johnson answered

I believe that there would be a way to use labels and triggers, although I suspect you would have to use messages, in addition to what you mentioned. But that approach is likely to take longer and have more bugs. I am not confident that I could do what you want.

Process Flow, on the other hand, makes this easy. Here's a demo model:

Basically, the processor token pulls 10 items (1 lot) off of the list at a time, and processes them. The Queue token listens for when the queue content drops below 100. If it does, then the Queue token creates 100 more flow items in the 3D Queue object.

replenishingexample.fsm


5 |100000

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

Mischa Spelt avatar image
1 Like"
Mischa Spelt answered Gulati commented

If you want to do it without Process Flow, here are some steps you could take:

  • Set the source to release items at inter-arrival time 0, so they get created "infinitely" fast
  • On Reset of the queue, set two labels: WaitingForEntry to 100 and WaitingForExit to 80 (or whatever names you want to give them).
  • In the On Entry of the queue, decrease WaitingForEntry by one. If this makes it reach zero, call input.close() to stop the queue from receiving more items.
  • In the On Exit of the queue, decrease WaitingForExit by one. If this makes it reach 80, set WaitingForEntry back to 100 and call input.open() on the queue to make it start receiving from the source again.

Having said this, I would prefer Jordan's Process Flow approach. Also, a few remarks about your attached model:

object Q1 = model().find("Queue1");

is not going to work, Object needs to be spelled with a capital O. However, you do not need this: you are inside a trigger on Queue1, so you can access the queue through the variable current (that comes predefined on line 2).

Similarly, if you want to get the source (which I don't think you really need) it's safer to use

Object S1 = current.inObjects[1];

to get the object connected to the first input port of current (the queue) such that your code will not break if you later decide to rename the source.

Finally, note that getbatch does not do what you expect: this command is intended for use with Process Flow:

Gets the batch in a Batch activity by token or Group By value.

(emphasis mine).

· 1
5 |100000

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

Gulati avatar image Gulati commented ·

@Mischa Spelt as per your suggestion i tried to follow mentioned steps.i set two labels in reset tab of queue.but i am not able to get 3 and 4 point mentioned by you. how to perform those steps. like at queue on entry decrese waiting for queue by one you mentioned. how to perform it can you please demonstrate it with a simple model.

0 Likes 0 ·