Operator Priority

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
Angs
Posts: 2
Joined: Wednesday 07 December, 2011 - 13:10

Operator Priority

Post by Angs »

Hello EDC

I have a question about priority of operators.
I have made a simulation of an production with operators.
But I have a problem:
I have made a priority of operators on a server "CallOperators(AtomByName([TeamMainAssembly],Model),1,1,[p1],[p2],[p3],[p4],[p5],[p6],[p7])" in trigger on exit.

If P1 is admitted to another server than I want the server to call P2 but it just picks a random operator.

How can I ensure that the server calls the right operators - as the priority?

From

A
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Operator Priority

Post by marlies »

Hi,

I tried to reproduce the problem and found out that the comparison of names in the Team atom is case sensitive. Could it be that you used P1 for the operator name and p1 in the calloperators functions?
Find attached a small example model that uses the strategy you described.

Regards,

Marlies
Attachments
OperatorPrio.mod
(39.48 KiB) Downloaded 337 times
marlies
Posts: 301
Joined: Monday 17 January, 2011 - 09:28

Re: Operator Priority

Post by marlies »

Hi Angs,

As you explained to me in the pm, you would like to have different operator priority rules depending the type of task. Unfortunately this cannot be achieved by changing the sequence of operator names in the calloperators function. I tried to implement a solution in the attached model. I hope that it will work for your situation as well.

I modelled: blue and green have preference on the servers 1 to 3. Red and pink have preference on the server 4 to 6.

What I used is: the trigger when called and when freed on the operator atoms. When called they increase a label on the team atom, when freed they decrease the label. The servers 4 to 6 check if the operators red and pink have been called by other servers (the label secondprio). In that way you know if there are any preferred ones available. If this is the case you create a call for these operators only. If it is not the case you create a call for all operators, then you will get the first available from all operators.

Regards,

Marlies
Attachments
OperatorPrio2.mod
(45.76 KiB) Downloaded 351 times
Angs
Posts: 2
Joined: Wednesday 07 December, 2011 - 13:10

Re: Operator Priority

Post by Angs »

Hi

Thanks a lot :)
Post Reply