Priority Rules for Queue

252 views
Skip to first unread message

Lewis Jack

unread,
Apr 20, 2022, 12:38:02 PM4/20/22
to Jaamsim Users Discussion Group
Hi Harry,

I'm looking to do a quick and basic simulation of the schedule used for my company to use in my dissertation. 

I wanted to apply a 'Shortest Processing Time' priority rule to the queue at the single server replicating the vehicle service bay. I've looked through the manual and the only reference to the priority rule function is for FIFO and LIFO. Is there a way of getting the queue to put the SimEntity's with the shortest processing time at the front?

Many Thanks,
Lewis

Harry King

unread,
Apr 21, 2022, 9:30:38 PM4/21/22
to Jaamsim Users Discussion Group
Lewis,

Use the Priority input for the Queue. If your SimEntity has an attribute that is set to the required processing time, say 'processingTime', then the input to the Priority keyword would be 'this.obj.processingTime / 1[min]'. Note that the Priority keyword expects a dimensionless value that is truncated internally to an integer. An advantage of this requirement is that processing times of say 3.1 and 3.6 minutes are both assigned a priority of 3. Otherwise, a tiny difference in processing time would allow one entity to jump ahead of another in the queue. If your processing times are much larger or smaller than 1 minute, you may want to divide by a larger or smaller time.

Harry

Lewis Jack

unread,
Apr 23, 2022, 1:17:37 PM4/23/22
to Jaamsim Users Discussion Group
Hi Harry,

Thank you for the response that's great. One last question how do I assign the SimEntity an attribute assigned by an Exponential distribution which I've set limits on (in Mins)?

Many thanks in advanced again,
Lewis

Harry King

unread,
Apr 23, 2022, 2:04:31 PM4/23/22
to Jaamsim Users Discussion Group
Lewis,

The only way to change an Attribute value is to use an Assign object. Place it immediately after you EntityGenerator. If your attribute is 'serviceTime' then the input to the AttributeAssignmentList input would be:
{ 'this.obj.serviceTime = [ExponentialDistribution1].Value' }

A new random sample will be made every time this assignment expression is executed.

Harry

Lewis Jack

unread,
Apr 29, 2022, 11:55:21 AM4/29/22
to Jaamsim Users Discussion Group
Hi Harry,

Sorry but I have struggled a little. I found a model from 2014 in the forum which did a similar thing to what I've been trying which didn't work but I have got it working now. I changed to suit my Simulation now and have got the priority rule working in the queue which is great. Hopefully I am very close now but the model doesn't do exactly what I want.

I have attached the model to make things easier so you can understand what it is I'm doing and have done more. 

I have the SimEntity being assigned a 'ServiceTime' (in minutes) which is called 'a' at the moment. This is generated by the TraingularDistribution and then used to prioritise it in the queue. However, for the actual Server1 the serviceTime in the model I found was being generated by a NormalDistribution, but what I would like is for the time the Server1 takes to serve the SimEntity be the ServiceTime that has been Assigned to it 'a'. The problem I'm struggling to get around I believe is that the Assign can only handle a Dimmensionless Unit so the output on the 'a' is dimensionless and I can't manage to get the Server1 to read the 'a' value in minutes to use it as the ServiceTime.

Does that make sense? Otherwise i have a priority rule using the service time to order the sims but then a completely random time to service being generated which negates the point in the priority rule in the first place.

Hope this makes sense and let me know if the model comes through correctly.

Many Thanks again,
Lewis

Future State Schedule Simulation 2.cfg

Harry King

unread,
Apr 29, 2022, 12:37:19 PM4/29/22
to Jaamsim Users Discussion Group
Lewis,

Attributes do not have to be dimensionless. Change your definition of 'a' to { a 0[s] } and assign it a value with units of time, i.e. { 'this.obj.a = [TriangularDistribution1].Value' }. You only need to convert to a dimensionless value when you assign the Priority input for the Queue, i.e. the input should be this.obj.a/1[min].  Now you can use the attribute 'a' to set the ServiceTime input for the Server by entering this.obj.a.

Harry

Lewis Jack

unread,
Apr 30, 2022, 6:56:32 AM4/30/22
to Jaamsim Users Discussion Group
Hi Harry,

I understand now thank you so much for your help, I've got it working now that's brilliant thank you I realise my mistakes now. I really appreciate your help and knowledge.

Have a good weekend.

Lewis

Reply all
Reply to author
Forward
0 new messages