Expression Field on List has not the same result as on a Script.

Expression Field on List has not the same result as on a Script.

jouky_d
Not applicable
24 Views
6 Replies
Message 1 of 7

Expression Field on List has not the same result as on a Script.

jouky_d
Not applicable

[ FlexSim 23.1.2 ]

Hello everyone,
I am trying to make a List with an Expression Field called Distance. However, when I pull it using Order By distance DESC or ASC, it always return the same value. I printed the results of each element on the list of the distance value, and it results the same value, however they are not in the same position. I ran a script with the same code at that time, and the distance value is correct on the script while is not on the Expression Field on List.


1684162663635.png



1684162693474.png

1684162738048.png


0 Likes
Accepted solutions (1)
25 Views
6 Replies
Replies (6)
Message 2 of 7

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Jouky D,

It's hard to know how to help without looking at your model. To receive a more accurate solution, please post your model or a sample model that demonstrates your question.

Proprietary models can be posted as a private question visible only to FlexSim U.S. support staff. You can also contact your local FlexSim distributor for phone or email help.

A guess that I have is that your puller is not correct for the list. Have you been able to see what values it is returning for the distance in the list? There are a few way to debug this. You can view entries and use the Properties panel to test pull queries.

1684163564784.png

0 Likes
Message 3 of 7

jouky_d
Not applicable
Yes, all the values of distance are the same.
0 Likes
Message 4 of 7

Jeanette_Fullmer
Community Manager
Community Manager
Accepted solution

Rather than pointing to an AGV class can you point to the object class of the agv? In line 10, it could be like the following

double distance = distancetotravel(agv.object, cp);
Message 5 of 7

jouky_d
Not applicable
That's it!
0 Likes
Message 6 of 7

jouky_d
Not applicable
Thank you!!:D
0 Likes
Message 7 of 7

jouky_d
Not applicable
I can't see where do I have to click to accept the response this time.
0 Likes