JohnDSalt Posted September 17, 2016 Share Posted September 17, 2016 How do you define a new state variable for an entity type? I mean here the things that arrive and travel through he model (they would be temporary entities in SIMSCRIPT II.5, transactions in GPSS/H, workpieces in Simul_. I have consulted the online help, and gone through the SimBits that looked as if they should be relevant, but cannot find an answer anywhere. I am attempting the embarrassingly simple task of randomly assigning a priority, 1..3, to an entity on arrival into the model, and later having them queue FIFO within priority class for service. As I do not need dynamic priority I expect a parameter would do instead of a state, but either way I cannot find how to perform the simple task of defining a field for an entity class. Once that is done I expect assigning to it should be easy. All the best, John. Link to comment Share on other sites More sharing options...
ptkolodziejczyk Posted September 19, 2016 Share Posted September 19, 2016 First, in your project navigate to ModelEntity or any other entity class. Right top corner. Then, in the definitions tab the third group is states, where you can define variables. These are then specific to the entity class. Link to comment Share on other sites More sharing options...
dsturrock Posted September 19, 2016 Share Posted September 19, 2016 Please note that to do exactly what you request, doesn't even require you to define a new state because there is already a predefined state named Priority that is inherited from the base Entity (expand the Inherited states in that same place illustrated below): And likewise, the default for queuing on a LVF or HVF already uses that state: If you want to assign a random value to Priority, use the State Assignments on Source (or any other object) something like this: Link to comment Share on other sites More sharing options...
Recommended Posts