Comparing two values of a label

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
IrisED
Posts: 2
Joined: Saturday 28 December, 2013 - 14:40

Comparing two values of a label

Post by IrisED »

I am working on a model about maintenance. The machine breaksdown with a Weibull distribution (mean 20). In order to improve the efficiency of the machine, preventive maintenance is introduced (exponential distributed with mean 20). Normal maintenance taken 10 seconds, preventive 5 seconds. After the maintenance the cycle 'resets' e.g. starts over.
I am trying to model this in ED with 2 sources that generate a number (label[Time]) for an atom. The system should then compare these two numbers and take the minimum and shoot that atom to the maintenance (I don’t know if this should happen in a server, queue or something else) and the other in the sink dump. In the server the maintenance takes place. Depending on from which source the atom came (Weib/Exp) maintenance takes 5 or 10 seconds (This I can model with another Label).

The problem is that I don’t know how I can compare the 2 atoms (both with label[Time]) and shoot one atom to the server and one to the sink dump.

Also I am wondering if I am modeling this with the right approach or that there is a more efficient way in ED.

I have attached the model. (I know I have to implement a lock or something to prevent that the model keeps generating atoms while the system is busy).

I hope someone can help me. Thank you in advance!

Kind regards,
Iris
Attachments
Maintenance.mod
(23.03 KiB) Downloaded 246 times
SimonvdW
Posts: 47
Joined: Thursday 06 January, 2011 - 09:52

Re: Comparing two values of a label

Post by SimonvdW »

Hi Iris,

I will try to give some support.
First of all it is a possible way of comparing 2 atoms with the same label name. I attached a model where I changed/added some code to make it happen. In this model I added some text commments to explain the code.

At first you will have to control the sources that create maintenance info. I use the closeoutput command to block the outputs. The queue collects an atom of each source. The first arrival closes the output of the queue (trigger on entry) to prevend it from immediate further transport.
When the second atom arrives it first decides its position. The queue discipline option arranges the atoms such that the atom with the shortest time is ranked first. I use the label 'NextTime' instead of your label 'Time' (allocated in the Sources), as Time is an internal function in ED.

Again in the trigger on entry it is declared that when 2 atoms are in the queue it can be opened again. The first atom that can leave it the one in front with the shortest time. The Sendto command defines that this atom goes to output 1 (the Maintenance server) and the second to the sink, as Round robin uses always a fixed order: 1- 2 - 1 - 2- 1 ...

As the outputs of the sources are still closed, no new atoms are created. Once an atom is in the maintenance server it will start during the processing time on lable 'MainT' (it is declared on the product, not on the machine !!). After the maintenance time it is time to reopen the outputs of the sources again (referred throught the channel connections !) and the proces starts over again.

Hope this will help you.

Regards,
Simon
Attachments
Maintenance_02.mod
(24.08 KiB) Downloaded 284 times
IrisED
Posts: 2
Joined: Saturday 28 December, 2013 - 14:40

Re: Comparing two values of a label

Post by IrisED »

Hi Simon,

Thank you very much for your help. The notes make it much more clear!

Regards
Post Reply