question

Nicolas Mbz avatar image
0 Likes"
Nicolas Mbz asked Matthew Gillespie commented

How to use a custom function to order by in zone queue strategy ?

I would like to order the entrance of tokens by theirs labels. Choice 1 : Duration, Choice 2 NbEtapes (Model Parameters).

I would like to use a custom function to determinate de queue strategy in the zone. But the error message :

"syntax error, unexpected identifier Object, expecting end of code. Make sure commas, parentheses, etc. are placed correctly".

1) How to use the custom function ind the Zone Queue strategy field ?

1692113349907.png


2) I would like to controle the order, by cloning the result in a globale table for exemple. Is this possible ?

Thanks in advance


Zone_OrderBy_CustomRequest.fsm

FlexSim 23.1.4
zonecustomcodequeue strategy
5 |100000

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

1 Answer

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Matthew Gillespie commented

You can do this by setting the node to an option value using the OnSet of the parameter:

1692195555053.png

zone-orderby-customrequest_jl.fsm

To see the result I would use a statistics collector to detect tokens entering the zone. You can query that as if it were a global table.


· 5
5 |100000

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

Nicolas Mbz avatar image Nicolas Mbz commented ·
ok, it's another way to do it, and it works, thanks a lot !


However, I would like to anderstand why this error appears ?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Nicolas Mbz commented ·
@Nicolas M25, if this code gets precompiled, then variable requete is empty. Maybe you can assign instead the else assigned value as default declared value.
0 Likes 0 ·
Nicolas Mbz avatar image Nicolas Mbz Nicolas Mbz commented ·

@Joerg Vogel thanks for your answer. Sorry, I don't anderstand very well (not a dev ;)). Can you show me an example in the micro model attached please ? Thanks in advance

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Nicolas Mbz commented ·
I don't think that field is evaluated to find an expression for the order by clause, it uses the value as the order by clause.
0 Likes 0 ·
Show more comments