Conditional distribution over the servers

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
droid86
Posts: 3
Joined: Thursday 24 January, 2013 - 13:05

Conditional distribution over the servers

Post 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?
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Conditional distribution over the servers

Post 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
Attachments
20130124_Cashregister.mod
(23 KiB) Downloaded 363 times
droid86
Posts: 3
Joined: Thursday 24 January, 2013 - 13:05

Re: Conditional distribution over the servers

Post by droid86 »

Thanks alot for the quick response.
This is helped me alot!
droid86
Posts: 3
Joined: Thursday 24 January, 2013 - 13:05

Re: Conditional distribution over the servers

Post 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.
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Conditional distribution over the servers

Post 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
zohaa3492
Posts: 1
Joined: Thursday 11 December, 2014 - 05:35

Re: Conditional distribution over the servers

Post by zohaa3492 »

Found i use a attribute for say if open or not

thank u
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: Conditional distribution over the servers

Post 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
Post Reply