Ability to have entity container take all available entities and process through an entity delay on cycle?

473 views
Skip to first unread message

jaamsim...@gmail.com

unread,
Jun 17, 2016, 1:21:29 PM6/17/16
to Jaamsim Users Discussion Group
When using an entity container is there a way to take all present entities, an unlimited amount instead of a predefined quantity, in its queue?  After the entity container collects the entities from queue it moves through an entity delay which duration runs off of a distribution.  Once the entity container finishes the run through the entity delay, I want an entity container to pick up all present entities(created from gen) in its queue and start the process all over again as if on a cycle.

Is there a way to do this in Jaamsim with pack and unpack?
Is there a way to do this in Jaamsim with addto and removefrom?


JL
ContainerCycle_test.cfg

danielc...@gmail.com

unread,
Jun 17, 2016, 2:57:25 PM6/17/16
to Jaamsim Users Discussion Group
For anyone that can help

I need some assistance in this area as well to build model. I attempt to make model for train car ride with start to finish. Train car is on distribution formula as entity container. Entities as people. Train car picks up all waiting passenger and goes to finish on entity delay controlled by distribution. Once complete, new train car picks up all waiting passengers at start and goes to finish. I want new train car to start when old one finishes. If I set container to 5 entities train car wont go until it reaches 5. Sometimes it may be 5 passengers waiting but sometimes less or more. How to get train car to start when old one ends and take "x" number of passengers waiting no matter what?

Daniel

Harry King

unread,
Jun 17, 2016, 5:27:09 PM6/17/16
to Jaamsim Users Discussion Group
JL and Daniel,

You can control the number of entities packed by your Pack or AddTo object by entering a suitable expression as the input to the NumberOfEntities keyword. For example, to pack all the entities in the queue, enter the expression [Queue1].QueueLength, where Queue1 is the queue for the entities waiting to be packed. The NumberOfEntities input is tested just once per EntityContainer, when packing is about to being. You can modify this expression as required to place a minimum and/or maximum number of entities to pack.

Harry

jaamsim...@gmail.com

unread,
Jun 20, 2016, 7:51:38 AM6/20/16
to Jaamsim Users Discussion Group
Harry,

I have tried both the following expressions and end with an error of "Pack1: The NumberOfEntities input must be greater than zero.  Received: 0":

'[PackQueue].QueueLength > 0'
'[PackQueue].QueueLength'

Unsure of where I went wrong.

JL
ContainerCycle_test2.cfg

Harry King

unread,
Jun 20, 2016, 2:10:03 PM6/20/16
to Jaamsim Users Discussion Group
Hi JL,

The error message occurs because the input '[PackQueue].QueueLength' allows the Pack object to start work with an empty queue. To fix the problem, replace the expression with 'max([PackQueue].QueueLength, 1)'. The model will now work error free, but the logic isn't quite right yet, because as soon as the first entity enters the PackQueue, the expression is satisfied and an EntityContainer is packed with a single entity. The remainder of the entities finish entering the queue while the first one is packed, so the second container is packed with all the remaining entities. The only way to change this behaviour is to use the OperatingThreshold input to activate the Pack object when all the entities are in the queue and you want packing to beginning. A simple way to do this would be to remove the Gate object and enter the TimeSeriesThreshold to the Pack object's OperatingThreshold input.

Harry

jaamsim...@gmail.com

unread,
Jun 21, 2016, 8:02:58 AM6/21/16
to Jaamsim Users Discussion Group
Harry,

Yes, it works error free now.  Thank you.  This is exactly what I wanted to achieve.  Last piece for completion to this model would be to have the containers start when the one in front of it completes Entity Delay route.

Is there a way to associate the Pack object's OperatingThreshold input with a distribution?  Looking to have only one EntityContainer (filled with x amount of entities) object operating on the Entity Delay at one time and once the first one finishes, the next EntityContainer begins and so forth.  Is there a way to hold an EntityContainer from starting on the Entity Delay until the one in front completes the Entity Delay evolution?  Kind of like a stop light/stop sign operating but based on a distribution.

JL
ContainerCycle_test3.cfg

jaamsim...@gmail.com

unread,
Jun 21, 2016, 10:01:34 AM6/21/16
to Jaamsim Users Discussion Group
Harry,

I tried adding seize, release, and resource objects to control the flow of the containers in the evolution but come up with the follow error: "PackQueue: Cannot remove an entity from an empty queue"
I realize I may be going about this wrong to achieve the results I stated in the previous posted message.  Is there another/better way than what I attempted?  

Updated model attached with my attempt to solve my question in the previous message.

JL
ContainerCycle_test4.cfg

Harry King

unread,
Jun 21, 2016, 11:34:16 AM6/21/16
to Jaamsim Users Discussion Group
JL,

Last piece for completion to this model would be to have the containers start when the one in front of it completes Entity Delay route.
HK - add an ExpressionThreshold that checks whether the EntityDelay is empty. See the attached model.

Is there a way to associate the Pack object's OperatingThreshold input with a distribution?
HK - Yes, but before going into details, can you describe how you want to randomise the OperatingThreshold input?

Harry
ContainerCycle_test3 - HK.cfg

Harry King

unread,
Jun 21, 2016, 11:43:57 AM6/21/16
to Jaamsim Users Discussion Group
JL,

I tried adding seize, release, and resource objects to control the flow of the containers in the evolution but come up with the follow error: "PackQueue: Cannot remove an entity from an empty queue"

The problem is that both the Seize and Pack objects use the same queue. This cannot work because the Pack object expects entities and the Seize object would place EntityContainers in it. I'll see if the error handling can be improved to make this more obvious.

See my previous reply for the best way to get the functionality you want.

Harry

jaamsim...@gmail.com

unread,
Jun 21, 2016, 12:46:28 PM6/21/16
to Jaamsim Users Discussion Group
Harry,

Understood.  Thank you for the clarification.
For the OperatingThreshold input I would like it to be randomized by and controlled just the same way the build server is being controlled by the weibull distribution.  I am attempting to achieve the process where EntityContainers process one after the other in a continuous cycle.  I have data that made up the weibull dist. and would like the time cycle to mimic this.  I see how adding an ExpressionThreshold works to check whether the EntityDelay is empty works for what I am trying to achieve without error.  Last part of this model would be to figure out a way to start the process of an EntityContainer travelling through the EntityDelay but only at the time of the EntityContainer ahead completing this same circuit on the EntityDelay which is governed by the weibull distribution.
I hope I make sense with what I am trying to achieve.  My sentences were a bit wordy. 

Thank you again advance.

JL

Harry King

unread,
Jun 22, 2016, 1:03:34 AM6/22/16
to Jaamsim Users Discussion Group
JL,
 
Last part of this model would be to figure out a way to start the process of an EntityContainer travelling through the EntityDelay but only at the time of the EntityContainer ahead completing this same circuit on the EntityDelay which is governed by the weibull distribution.
HK - Didn't the ExpressionThreshold achieve this behaviour already? Or, did you want the unpacking to finish before the next EntityContainer is filled? If that is the case, you can modify the ExpressionThreshold to require the Unpack object to be idle.

What I don't understand about using a distribution with the ExpressionThreshold is how exactly is it being randomised. Do you want the EntityContainer to start at a random time after the previous one completes the EntityDelay?

Harry

jaamsim...@gmail.com

unread,
Jun 22, 2016, 10:02:36 AM6/22/16
to Jaamsim Users Discussion Group
Harry,

It did but another EntityContainer would be packed and travelling at the same time as the EntityContainer ahead of it which is not the desired result.  Yes, I want the unpacking to finish before the next EntityContainer is filled.  Once the unpacking is finished I would like the next EntityContainer to be triggered to pack entities in that queue and travel down the EntityDelay.  I do not want the EntityContainer to start at a random time but at the same time the previous one completes the EntityDelay.  This entire process is wanted to be governed by a weibull distribution.

My apologies for the confusion in words.

JL

jaamsim...@gmail.com

unread,
Jun 22, 2016, 11:19:43 AM6/22/16
to Jaamsim Users Discussion Group
Harry,

Currently working and trying to figure out a solution to issues outlined in the previous messages.  The attached model is my current state.

JL
ContainerCycle_test2.cfg

Harry King

unread,
Jun 22, 2016, 12:34:49 PM6/22/16
to Jaamsim Users Discussion Group
JL,
 
Yes, I want the unpacking to finish before the next EntityContainer is filled.  Once the unpacking is finished I would like the next EntityContainer to be triggered to pack entities in that queue and travel down the EntityDelay.  I do not want the EntityContainer to start at a random time but at the same time the previous one completes the EntityDelay.  This entire process is wanted to be governed by a weibull distribution.

Okay, that makes sense now. The solution is to change the OpenCondition input for the BuildThreshold to 

'[BuildServer].NumberInProgress==0 && ![Unpack1].Working'

This expression will delay the start of packing until the previous EntityContainer has finished both the EntityDelay and the unpacking process.

Incidentally, do you want to use a new EntityContainer each time or would the real system re-cycle the container back to the packing station? If the latter, you could model your system more simply by replacing the Pack and Unpack objects with AddTo and RemoveFrom objects. You wouldn't need to use the BuildThreshold in this case.

Harry

jaamsim...@gmail.com

unread,
Jun 22, 2016, 12:59:19 PM6/22/16
to Jaamsim Users Discussion Group
Harry,

Yes, it works perfectly now.  Thank you very much.  To be honest for the model, either a new EntityContainer or a real system re-cycle of the container to the packing station could work.  Just to make sure I understood, I modeled out the latter option you provided.  I believe I have everything connected and working properly with 01 EntityContainer in the cycle.  Would you please verify that I associated the objects appropriately?

Thank you

JL
ContainerCycle_test3.cfg

jaamsim...@gmail.com

unread,
Jun 22, 2016, 1:17:26 PM6/22/16
to Jaamsim Users Discussion Group
Harry,

I believe I will be using the pack/unpack method opposed to the add/remove method for this model.  I say this because when running the model to completion with the add/remove method I am left with the EntityContainer being idle at the add object filled with entities.  I would like to know if there is a way around this issue so I may have the knowledge to navigate this error in the future.

My findings were based off of the ContainerCycle_test3 model from the last message.

JL

Harry King

unread,
Jun 22, 2016, 1:17:51 PM6/22/16
to Jaamsim Users Discussion Group
JL,

A couple of things needed to be changed:

1) BuildServer must send the EntityContainers to RemoveFrom1 (its not connected in the version you sent)

2) RemoveFrom1 must send the EntityContainers to Queue1 (instead of AddTo1)

The modified inputs are attached.

Do you still need the TimeSeries, TimeSeriesThreshold, EntitySignals, and SignalThreshold objects? The don't do anything in the present model.

Harry
ContainerCycle_test3 - HK.cfg

Harry King

unread,
Jun 22, 2016, 1:34:18 PM6/22/16
to Jaamsim Users Discussion Group
JL,


when running the model to completion with the add/remove method I am left with the EntityContainer being idle at the add object filled with entities

You can control the AddTo object with its OperatingThreshold input in the same way that you did for the Pack object. This input will allow you to fine tune the logic for when to pack the container.

Harry

jaamsim...@gmail.com

unread,
Jun 22, 2016, 1:34:30 PM6/22/16
to Jaamsim Users Discussion Group
Harry,

Yes, I do not need the TimeSeries, TimeSeriesThreshold, EntitySignals, and SignalThreshold objects and have deleted them in the model attached.  However, I still believe I will be using the pack/unpack method opposed to the add/remove method for this model.  I say this because when running the model to completion with the add/remove method I am left with the EntityContainer being idle at the add object filled with entities.  I would like to know if there is a way around this issue so I may have the knowledge to navigate this error in the future.

Sorry for the redundancy.  I believe we posted around the same time.

JL
ContainerCycle_test4.cfg

jaamsim...@gmail.com

unread,
Jun 22, 2016, 1:43:57 PM6/22/16
to Jaamsim Users Discussion Group
Harry,

I have the AddTo object controlled with the OperatingThreshold input as you described but still having the issue of the EntityContainer being idle at the AddTo1 object for some reason.

JL
ContainerCycle_test5.cfg

Harry King

unread,
Jul 10, 2016, 2:35:24 PM7/10/16
to Jaamsim Users Discussion Group
JL,

I seem to have forgotten this question -- does it still need to be answered, or have you figured it out yourself?

Harry

jaamsim...@gmail.com

unread,
Jul 12, 2016, 8:03:23 AM7/12/16
to Jaamsim Users Discussion Group
Harry,

No worries.  Yes, I was able to figure it out.  Thank you.

JL
Reply all
Reply to author
Forward
0 new messages