special product

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
tokkitrooi
Posts: 7
Joined: Friday 25 March, 2011 - 13:11

special product

Post by tokkitrooi »

Assume there are 8 different products (all have different meanvalues and they are all n-exponential distributed)

One of the 8 products has in relation to the other product, a very high mean value, so for example

1: 200 minutes
2: 210 minutes
3: 190 minutes
4: 211 minutes
5: 15000 minutes
6: 222 minutes
7: 232 minutes
8: 197 minutes

The ''big'' order caused a very long waiting time, and that is something we don't want. So the idea is to use a sort op SPT rule.

The rule is as following:

when some product arrives (not the big products) and the big products is in the machine, the work will be stopped and the smaller product will go first. After that (when there are no other small products) the big product will go back on the machine.


I think this is a very interesting problem to solve with ED, can someone help to solve this?
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: special product

Post by marlies »

I made a small example how to model this problem. See the attachment SpecialProduct.mod. The upper side of the model is a queue-server-sink with SPT logic only. The lower side is a queue-server-sink with code to interrupt the long jobs on the server.

The idea of that is:
- On exit of the source the type of product and the server processtime are determined.
- The queue has a sortby SPT queue discipline.
- In the entrytrigger the queue checks if the resttime of the product currently in the server is longer than the criterium. If that is the case, the server is stopped by destroying the events and that atom is moved back into the queue.
Attachments
SpecialProduct.mod
(34.02 KiB) Downloaded 437 times
tokkitrooi
Posts: 7
Joined: Friday 25 March, 2011 - 13:11

Re: special product

Post by tokkitrooi »

Thank you for the answer!

The ''bezettingsgraad'' of the server can be higher than 100% (sometimes 600%), is this possible? (in don't think so)

Furthermore, in this situation, we only detect the average waittime, so not for the specific products. Is it possible to detect the average waittime for every product? I think is it difficult, because we destroy the atom and ''build'' a new one with the remaining time, so we loss the waittime in this case..

Maybe, we can say the following:

if the productname = 1 or 2 or 3... (for example) then store the waittime (the difference between server en queue) and save them in a cell (of a table) etc. etc.

if the product is the special product (so 5) then we do the same, but then we have to devide by the number of products that are produced and not by the number of created products(by destroying etc.)

I hope it is clear for you to understand the problem, but i don't really know how to handle this...
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: special product

Post by marlies »

You are right about the utilization. There were some attributes of the server that needed to be updated to calculate the utilization correctly (TotalBusy and EndBusy). In the attached model I added some lines to the entrytrigger of the queue.

For the waittimes I would suggest to create a table where you registrate the total waittime and the nr of products produced per type. The total waittime can be increased every time a product leaves the queue by the calculation: time - entrytime(i).

You mentioned that the special product atoms are destroyed and recreated. But that is not the case. The entrytrigger of the queue destroys the events of the server atom. But just moves the special product back into the queue. So, the solution could be: store the total waiting time on a label on the product atom itself and increase this every time the product leaves the queue. Registrate the waitingtime and product in the table when it is completely finished. For example in the exittrigger of the server:

Code: Select all

If(
 Label([RestProcessTime], i) > 0,
 Output(c) := Output(c) - 1,
 Do({ create some code to registrate the waittime of the exiting product },[])
)
Attachments
SpecialProduct01.mod
(39.24 KiB) Downloaded 395 times
tokkitrooi
Posts: 7
Joined: Friday 25 March, 2011 - 13:11

Re: special product

Post by tokkitrooi »

If(
Label([RestProcessTime], i) > 0,
Output(c) := Output(c) - 1,
Do( label([waittime],i) := label([waittime],i)+ time - entrytime,)
)

Like this? or isn't this enough?
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: special product

Post by MatthijsJongboer »

When there is no processtime left, the waittime label contains the total processtimes of all re-entries.
Seems that this is what you were looking for.
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: special product

Post by marlies »

Yes, this is part of the code you need. But the line Do( label([waittime],i) := label([waittime],i)+ time - entrytime(i)) should be in the exittriger of the queue not of the server. In the exittrigger of the server you can write the result to a table.
shanebishop
Posts: 1
Joined: Thursday 21 July, 2011 - 08:21

Re: special product

Post by shanebishop »

Is there any way to adjust this code to allow higher mean value? I have the same problem and sadly the solution doesn't work for me.
SimonvdW
Posts: 47
Joined: Thursday 06 January, 2011 - 09:52

Re: special product

Post by SimonvdW »

What do you exactly mean with higher mean values? The average process times per product type?
In fact the solution should also work when you use higher values for the process times, for example hours instead of minutes. Howeverin that case you should adjust the inter arrival times in the source accordingly. Otherwise you feed the model with much more entries than the server can process.
Post Reply