Jump to content

Operator with Priority


eliaoey

Recommended Posts

Hi All,


I have server 1 & server 2, each sharing the same operator. Whenever operators are available, I want the operator always prioritize entity in Server 1 instead of Server 2 (even when they come later). I tried to do it using "Dynamic Selection Rule" by expression "candidate.entity.priority", as per the attached model. But it did not work as expected.


in 15th second of the simulation run, the operators still go to server 2 (where entity arrived first) instead to server 1.


Can anybody help? Thanks

Operator with priority.spfx

Link to comment
Share on other sites

  • 5 weeks later...

What you can do is within the Worker object's 'Evaluating Seize Request' add-on process, create a process. This process will then be called each time the worker is deciding whether to take on the entity seize request being made (if not, it will try again next time worker becomes available).


Add the following steps to the process:


Add a Decide step with Expression 'Entity.Location.Parent == Server2 && (Server1.InputBuffer.Contents > 0) ' - the Entity.Location.Parent will determine if the requesting entity is at Server2 and if so, if the Server1.InputBuffer has anyone in it - and if so, that means there are higher priority items to be worked on at the Server1.


From the True exit of the Decide , add an Assign step to assign the State variable 'Token.ReturnValue' to be the value of 'False' or '0'. This means that the entity request for the worker will be false (for this particular evaluation) - when the queue at Server1 resides, and the evaluation is again done, the token will exit the False exit of the Decide and the entity at Server2 will be able to seize the worker.

Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...