Feature Request: Calculating non-numerical values in an EntityExpression or similar

33 views
Skip to first unread message

Paul René

unread,
Jun 3, 2025, 6:30:57 AMJun 3
to JaamSim Users Discussion Group
Hello! Thank you so much for this software!
I have run into an issue that I think may easily be solved (and maybe I simply have not found how).

(tl;dr of the gray part below)

On a first level, I would like to have somewhere within the .config file only one Entity that holds a list of entities, e.g. {[Entity1], [Entity2], [Entity3]}, so that in other Entities, I can call to this one just like I would call an ExpressionEntity's value, and do something like 

ListOfThroughputs = map(  |x|(x.NumberAdded) , EntityList) 

Instead, the best workaround I've found is to use a FileToVector object, where I would have a EntityList.txt file in the same folder containing '{[Entity1], [Entity2], [Entity3]}', call it with the FileToVector object, and then use its Value, so that looks like:

ListOfThroughputs = map(  |x|(x.NumberAdded) , FileToVector1.Value(1))

It works quite well, but then I need to manually change the EntityList.txt whenever a change needs to be made, and afaik, there's no way to have it update in real time.

Therefore, I haven't found a way to compute an EntityList within the simulation and use it in other Entities.

An example of what I would like to do would be to, for instance, make it so my list EntityList only contains the Entities whose NumberAdded is below 100.


So, in short, I would like to have an Entity similar to an ExpressionEntity, where the Expression could hold something like:

entities =  {[Entity1], [Entity2], [Entity3]} ;
filter( |x|(x.NumberAdded < 100) , entities) 

And therefore its .Value would hold the list of Entities within "entities" whose NumberAdded is below 100.
Or any other lambda function.

Have I missed something that would work?

Many thanks in advance!

Harry King

unread,
Jun 6, 2025, 9:10:02 PMJun 6
to JaamSim Users Discussion Group
I'm not sure which entities you wish to include in your 'entities' list.

If you want to build a list of the generated entities that pass along a path, then add an Assign object to the path and set its AttributeDefinitionList input to:
{ entities '{}' } and its AttributeAssignmentList input to { 'this.entities(this.NumberAdded) = this.obj' }

Harry

Reply all
Reply to author
Forward
0 new messages