Creating Unique Inputs for Duplications of Submodels

125 views
Skip to first unread message

Samuel Ostby

unread,
Sep 21, 2022, 8:33:55 AM9/21/22
to Jaamsim Users Discussion Group
Hello all,

I am currently trying to simulate interactions between six (mostly identical) production lines. Objects being passed from line to line have different service times assigned for each line. I would like to assign respective ServiceTimes to servers within each submodel eg. ServiceTime for line 1 is this.obj.ServiceTime1 and ServiceTime for line 2 is this.obj.ServiceTime2. 

However, whenever I start the simulation, any changes I made to duplicates to the submodel are reverted back to the inputs of the original submodel. Is there a way to remedy this?

For context, the lines themselves are very complex, and I wanted to use the submodel functionality to "copy and paste" them in a timely manner as my main concern is simulating how they interact with each other. I would appreciate any insight anyone could provide.

Thank you,

Sam

Harry King

unread,
Sep 21, 2022, 11:21:37 AM9/21/22
to Jaamsim Users Discussion Group
Samuel,

My two posts under https://groups.google.com/g/jaamsim-users/c/hrwrTHcEIhg/m/a8F5HlgJAgAJ should answer your question.

Harry

Samuel Ostby

unread,
Sep 22, 2022, 10:14:43 AM9/22/22
to Jaamsim Users Discussion Group
Harry,

I was able to get the servers within each line to populate their ServiceTime input to "[Line1].ServiceTime","[Line2].ServiceTime" and so on. 

In my parent model, I have a Keyword expression, "{ ServiceTime TimeUnit }". 

Each entity has a prescribed amount of time to spend at each respective line with a "ServiceTime1" attribute for line 1, "ServiceTime2" attribute for line 2, and so on.

So for line 1, I have my ServiceTime attribute (under the Key Inputs tab) set to "this.obj.ServiceTime1".

When the object arrives to the server, I receive the following error message,
 "Line1.Server keyword 'ServiceTime':
  Line1:
  Trying to resolve output on null entity

  [Line1].ServiceTime"

I have attempted to remove units or move them to different levels, but have had no luck. What do you think I am missing? I also appreciate your continued support.

Thank you!

Sam

Harry King

unread,
Sep 22, 2022, 11:58:47 AM9/22/22
to Jaamsim Users Discussion Group
Sam,

The error message appears to say that the obj output for Line1 is null. Please show a screen capture of the error message pop-up so I can understand the error condition more clearly.

It would be best if you would attach your model (or email it to me) so I can see what is going on first hand.

Harry

samue...@gmail.com

unread,
Sep 22, 2022, 2:57:34 PM9/22/22
to Jaamsim Users Discussion Group
I have attached the files. Please let me know your thoughts when you get a chance to look at them.

Thank you!

Sam

LogicTest.cfg
Input.dat

Harry King

unread,
Sep 22, 2022, 5:13:49 PM9/22/22
to Jaamsim Users Discussion Group
Sam,

The problem is that the obj output for Line1 is null because you send the entities directly to the SubModelStart for each SubModel. Change this so that the entities are sent to each SubModel. This will set its obj output before passing the entity automatically to its SubModelStart.

The following are some additional things that you should change to improve your model:
  • Leave the NextComponent input for each SubModel blank so that the entity is passed back to the SubModel, and use the NextComponent input for the SubModel to direct the entity appropriately. Ideally, the objects in a SubModel should only reference each other or their parent SubModel. Similarly, they should not be referenced by objects outside the SubModel.
  • Rename Line1 to Line and remove it from the connects to other parts of the model. Drag and drop a new Line1 and use it as before in your model. In other words, restrict the model to using the SubModelClones you have dragged and dropped, and keep the Line SubModel separate.
  • Rename EntityConveyors 1, 2, etc. to C1, C2, etc. or something similar. Using a number as an entity name is a potential source of input errors and confusion.

Harry

Reply all
Reply to author
Forward
0 new messages