AddTo Match and String values

161 views
Skip to first unread message

rif...@gmail.com

unread,
Aug 16, 2017, 2:11:04 AM8/16/17
to Jaamsim Users Discussion Group
I have created a simple AddTo example that models the assembly of specific serialised Entities in a serialised ContainerEntity. The model can be extended to allow for 'n' assembly operations for Entities (and AddTo of ContainerEntities)

The attached example demonstrates this example.

The question I have is

'Is it possible to use STRING values for the match criteria, in lieu of integer values?'

Any suggestions would be appreciated.

Regards

RiF

rif...@gmail.com

unread,
Aug 16, 2017, 2:17:42 AM8/16/17
to Jaamsim Users Discussion Group, rif...@gmail.com

I can upload the example files if required.

Harry King

unread,
Aug 17, 2017, 4:43:31 PM8/17/17
to Jaamsim Users Discussion Group, rif...@gmail.com
Rif,

The 'Match' keyword can only accept an integer value or an expression that returns a dimensionless number. We don't have any plans to generalize it to accept a string or any other type of input. Perhaps if you attach your model I will see the motivation for this feature request. You will need to join the forum before you can add attachments to your posts.

Harry

rifr...@tpg.com.au

unread,
Aug 18, 2017, 12:33:24 AM8/18/17
to Jaamsim Users Discussion Group, rif...@gmail.com
Harry - Thanks for your response. 
The attached model contains the concept. On input file defines the Entity serial numbers;the other file defines the ContainerEntity serial number and the serial number of the entity to be added to. The Entity.txt file also contains SerialLabel for testing, and a third parameter that not used (in this model).

Currently, each EntityContainer has assigned to it an EntitySerialNumber of an entity which will be added via the AddTo process as the Match argument. The SerialNumber attribute is added to the Entities, and used as the store's Match argument.  Thus specific assemblies can be generated.

The complete scenario has SerialLabel defining the item to be assembled, including duplicates representing batch of objects. As the Match expression in JaamSim is dimensionless, I could pre-process all the string values to discrete integers, and map all the values appropriately. Though not pretty, this approach would address the Match as a string issue. The challenge is that all the Strings will need to be known a the start of the analysis, to allow the mapping to be complete. The SerialLabel could be any characters, or simple values such as Red, Green,....

Your thoughts on using AddTo with strings would be appreciated.

Regards

RiF
serialized_entity_AddTo.cfg
Entity.txt
EntityContainer.txt

Harry King

unread,
Aug 18, 2017, 5:41:54 PM8/18/17
to Jaamsim Users Discussion Group, rif...@gmail.com
RiF,

I'm giving your idea some serious thought. It is possible to make this change, and it seems to make a lot of sense. I'll get back to you in a few days after discussing this with my colleagues.

Harry

Harry King

unread,
Aug 28, 2017, 8:10:20 PM8/28/17
to Jaamsim Users Discussion Group, rif...@gmail.com
RiF,

We will include this feature in the next release.

Harry

Harry King

unread,
Sep 7, 2017, 1:24:15 PM9/7/17
to Jaamsim Users Discussion Group
RiF,

This feature is included in release 2017-10. The Match input for Queue, Server, Seize, etc. now accepts a string or an expression returning string.

Harry
Reply all
Reply to author
Forward
0 new messages