Submodel runtime error

15 views
Skip to first unread message

Joseph Jabbour

unread,
Jul 7, 2025, 12:37:08 PMJul 7
to JaamSim Users Discussion Group
I'm encountering a runtime error in JaamSim with `GuardedTransition1.AttributeGetter` when trying to assign a single value to an attribute in a cloned submodel. The error is:

GuardedTransition1.AttributeGetter (ASSIGN) keyword 'AttributeAssignmentList':
Expression does not evaluate to a collection or lambda type. { 'this.obj.branchAttribute = this.Parent.getAttributes(1)(1)' }

Details:
- My model is a clone of a submodel, and `GuardedTransition1` is part of this cloned structure.
- My goal is to assign the value `2.0` to `this.obj.branchAttribute` within `GuardedTransition1`.
- `this.Parent.getAttributes(1)(1) does not return `2.0``.
- `GetAttributeList` is a `FileToMatrix` object with `DataFile = SUBTRIALGETATTRIBUTELIST.txt`, and `[GetAttributeList].Value(1)` returns `{2.0, 0.0, 1.0, 0.0}`.
- The `SimEntity` (`this.obj`) has `AttributeDefinitionList = { { branchAttribute 0 } }`, expecting a single numeric value.
- The error occurs because `AttributeGetter` expects a collection or lambda type, but `this.Parent.getAttributes(1)(1)` returns a single value (`2.0`).
- I'm using `AttributeGetter` to define the attribute assignment within the `AttributeAssignmentList` keyword, e.g., `{ this.obj.branchAttribute = this.Parent.getAttributes(1)(1) }`.

Please advise on resolving the error and achieving the assignment in `GuardedTransition1` while maintaining compatibility with the submodel's cloning and attribute assignment structure.

Harry King

unread,
Jul 7, 2025, 12:58:49 PMJul 7
to JaamSim Users Discussion Group
All the problems you describe involve things that have been defined by your model, e.g.  GuardedTransition, AttributeGetter, getAttributes, branchAttribute. Did you write these parts of the model yourself or did you inherit the model from someone else? If you inherited the model, then you should talk to the person who wrote it.

It is impossible to help you without a copy of the model. If you don't want to post it on the forum, you can email it to me directly.

Harry

Reply all
Reply to author
Forward
0 new messages