You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an edge-gase and generally no problem for most L-Systems, but could still cause problems.
Solution
Recommended: use object-based productions like: successors: [{leftCtx: ...}, {leftCtx: ....}], because in that case, the order is preserved by the successors array.
setting productions via setProduction() in your prefered order
alternatively: change library. switch/allow to tuple-arrays in productions
The text was updated successfully, but these errors were encountered:
nylki
changed the title
multiple productions on same symbol: object order issues
multiple productions on same symbol: object order not preserved
Jan 22, 2017
lets say you have:
This is currently allowed. (Internally a
successors: []
is created).All three productions on 'B' meet the context sensitive condition.
You would expect to have 'X' returned, because it is the first in the list.
This is however not guaranteed to be the case, because object property order is not guaranteed to be preserved! See eg: http://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order/38218582#38218582
This is an edge-gase and generally no problem for most L-Systems, but could still cause problems.
Solution
Recommended: use object-based productions like:
successors: [{leftCtx: ...}, {leftCtx: ....}]
, because in that case, the order is preserved by the successors array.setting productions via
setProduction()
in your prefered orderalternatively: change library. switch/allow to tuple-arrays in
productions
The text was updated successfully, but these errors were encountered: