question

Jouky D avatar image
0 Likes"
Jouky D asked Jeanette F answered

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

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


FlexSim 23.1.2
listsdistancetotravelexpression field
1684162663635.png (32.0 KiB)
1684162693474.png (16.9 KiB)
1684162738048.png (16.5 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦♦ commented ·

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 0 ·
1684163564784.png (90.7 KiB)
Jouky D avatar image Jouky D Jeanette F ♦♦ commented ·
Yes, all the values of distance are the same.
0 Likes 0 ·

1 Answer

Jeanette F avatar image
1 Like"
Jeanette F answered

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);
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jouky D avatar image Jouky D commented ·
That's it!
0 Likes 0 ·
Jouky D avatar image Jouky D commented ·
Thank you!!:D
0 Likes 0 ·
Jouky D avatar image Jouky D commented ·
I can't see where do I have to click to accept the response this time.
0 Likes 0 ·