send to logical function if

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
mgalic
Posts: 8
Joined: Wednesday 01 October, 2014 - 16:07

send to logical function if

Post by mgalic »

Hi,

I'm having problems with a simple function in ED - send to strategy with if logical function! I need to structure a code by which each product (or batch) will go through a test: if product's time from EntryTime (in Server) till leaving the queue is < or = to 2 hours go to channel 1, else channel 2!
Meaning that if product spends more than 2 hours in server + waiting in queue send it to channel 2.
I've tried and tried, but with no results! Please help me and it is not necessary to appoint me to F1 (I'm fully aware of it and its confusing and misleading English!).
My last try obviously doesn’t solve my problem and is attached. Can anybody give me an advice?
Thank you,
Mario
Attachments
sendto - problem.mod
(8.37 KiB) Downloaded 252 times
mgalic
Posts: 8
Joined: Wednesday 01 October, 2014 - 16:07

Re: send to logical function if

Post by mgalic »

sorry, I've uploaded a wrong model

this is the right one
Attachments
sendto - problem.mod
(10.4 KiB) Downloaded 281 times
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: send to logical function if

Post by HarryBunnik »

Ha Mario,

If you set (on the OnExit trigger of your first server) a label on the leaving product that contains the time that a product is busy in the server:

Code: Select all

Label([TimeBeingServed], i) := Time - EntryTime(i)
And then check this on the SendTo statement that is on the Queue:

Code: Select all

If(
  Label([TimeBeingServed], first(c)) > hr(2), 
  2, 
  1
)
I think it's doing what you want. I've updated your model so you can have a look.I hope it helps you!
sendto - problem_vHB.mod
(10.47 KiB) Downloaded 290 times
Cheers,

Harry
mgalic
Posts: 8
Joined: Wednesday 01 October, 2014 - 16:07

Re: send to logical function if

Post by mgalic »

Hi Harry,

so far so good! Works like a charm :D

Thanks mate,
Mario
Post Reply