eliaoey Posted November 8, 2017 Share Posted November 8, 2017 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 More sharing options...
allenxing Posted December 7, 2017 Share Posted December 7, 2017 This is a good question, I double check the problem, but still at a loss. Hope any Master can help us, thank you in advance. Link to comment Share on other sites More sharing options...
CWatson Posted December 7, 2017 Share Posted December 7, 2017 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 More sharing options...
allenxing Posted December 22, 2017 Share Posted December 22, 2017 Entity.Location.Parent this is a perfact idea. Link to comment Share on other sites More sharing options...
Recommended Posts