Raimundo Yachan Posted April 17 Share Posted April 17 Hello SIMIO experts, I am currently working on a project where I need to assign state variables to a worker and manage these variables throughout the simulation. I'm looking for guidance on a few key aspects: Assigning a State Variable to a Worker: How can I assign a state variable (e.g., a boolean or numerical value) to a worker in SIMIO? I want to track attributes such as availability, task completion count, or other custom metrics. Updating the State Variable During the Simulation: What is the best practice for updating the state variable of a worker based on specific events or conditions during the simulation? For instance, updating the availability status when a worker starts or completes a task. Accessing the State Variable: How can I access or consult the state variable of a worker at any point in the simulation for monitoring or decision-making purposes? Any advice or example models that illustrate these processes would be greatly appreciated. Thank you for your help! Link to comment Share on other sites More sharing options...
dsturrock Posted April 17 Share Posted April 17 Before you start adding state variables to a library object, I suggest that you first familiarize yourself with all of the existing states. One easy way to do this is to instantiate the object (e.g., Worker1) and then go to any expression field and type "Worker." and look at the list. In the case of Worker, there are over 100 states, functions, and properties built-in to the Worker object. Another way is to subclass the Worker, then go to the Definitions tab of the MyWorker object and you can see all of the built-in definitions by category: There is a pretty good chance that what you need is already there. But if not, use the same screen illustrated above and add whatever state (or property, event, ...) that you need. As far as referencing or assigning that custom state or a built-in state, it is done using ObjectName.StateName. For example if you added a state named TimeStartedMove to MyWorker, and you wanted to assign that value, you might assign MyWorker.TimeStartedMove to TimeNow. The tricky part, especially with more complex objects like Workers, is to determine exactly when/how to assign that value. Sometimes you can interact with the model itself to insert an Assign at the correct location (let's say in the Loaded Add-on Process). Or sometimes you might need to override the process logic in your custom object. The SimBits RecordDistanceTraveled and ElectricVehicle are examples to review. Link to comment Share on other sites More sharing options...
JBeltran Posted April 26 Share Posted April 26 It would also be interesting to be able to modify or include new ResourceAutoStates, which are limited to those defined by default (Starved, Busy, etc). Link to comment Share on other sites More sharing options...
Raimundo Yachan Posted May 16 Author Share Posted May 16 @dsturrock Thank you, David, for your advice. I ultimately implemented the second method, creating a custom worker in which I set up a custom state variable that I could update and monitor without any issues. Thank you for your detailed response, Best regards, Raimundo Yachan Link to comment Share on other sites More sharing options...
Recommended Posts