Jump to content

Worker perform action on idle


Recommended Posts

Hi everyone.


I want a worker to perform an action if he does not have any seize requests.


I've uploaded an example of what i'm trying to achieve. Basically I want the worker to go to TransferNode1 and execute PerformIdleAction process whennever he doesn't have any entity, on either server1 or server2, requesting a ride from the worker.


I've tried to do this by checking the ResourceState variable of the worker and the Capacity.Allocated (http://www.simio.com/forums/viewtopic.php?f=6&hilit=worker%20busy&p=4154&t=1378), but my problem seems to be that I don't know how or when to check these states... I think a good way would be to have an add-on process OnIdle or something like that, so i'm having problems with this. Hope anyone can help me.


Thanks

example.spfx

Link to comment
Share on other sites

You can use the Worker's Idle Action property to send the worker, for example, to the home location (where it starts) - then, once the worker gets there, within the home node Entered add-on process, you can check to make sure there are no other entities waiting for the worker (in the time it took the worker to move to the home location). This can be done with a Decide step that checks "Worker1[1].VisitRequestQueue == 0".


Then, if the worker allocation queue is zero (meaning no entities waiting), you can Create an entity (of either type or another third type) that will Seize the worker and request it to move to the TransferNode1, Delay for some amount of time and then Release the worker.

Link to comment
Share on other sites

×
×
  • Create New...