Page 1 of 1

Conditional distribution over the servers

Posted: Thursday 24 January, 2013 - 13:08
by droid86
Hey,

I was wondering if someone is able to help me with a problem that i came a cross.
What i want to do i is give all incoming customers who enter the Queue give them a number random number between 0 and 30.
All customers have 10 or less products go to cashregister1 and all other customers who have more then 10 products go to cashregisters 2 to 10. Anyone that can help me with this problem?

Re: Conditional distribution over the servers

Posted: Thursday 24 January, 2013 - 14:01
by marlies
Hi,

What you need to do is set a label when you create the products (e.g. exittrigger of the source). In the attached example model I assigned a value uniformly distributed from 1-30. But you could also use an empirical distribution (category tools) when the distribution is not uniform.

In the queues you use the label to determine where the products should go. For the label <=10 to channel 1. For the other values to e.g. a random open channel.

I implemented this in the sendto statements of the different queues in the attached model.

Success, Marlies

Re: Conditional distribution over the servers

Posted: Thursday 24 January, 2013 - 14:21
by droid86
Thanks alot for the quick response.
This is helped me alot!

Re: Conditional distribution over the servers

Posted: Thursday 24 January, 2013 - 15:41
by droid86
Any chance u could also help me out with the following.
the cash registers need to only open when a certain amount of people are in queue 0-3 in one cash register
4-6 the second cash registers opens etc.
And if the amount of customers reduces the cash registers close again.

Re: Conditional distribution over the servers

Posted: Thursday 24 January, 2013 - 17:44
by marlies
Hi,

You can check the contents of the queue and decide about the channel/queue to use depending on the content.

For example in the common queue you would like to check the content of the queue connected to the 1st output channel, the 4Dscript to do that would be:

Code: Select all

content(out(1,c))
So, you will need to write some calculation to decide how many cash registers are in use.

Regards, Marlies

Re: Conditional distribution over the servers

Posted: Thursday 11 December, 2014 - 05:45
by zohaa3492
Found i use a attribute for say if open or not

thank u

Re: Conditional distribution over the servers

Posted: Thursday 11 December, 2014 - 09:51
by HarryBunnik
Hello Zola,

Can you clarify your question a bit? I'm afraid that I'm not sure what you want to ask.

Cheers,

Harry