question

Ludovica Pilleri avatar image
0 Likes"
Ludovica Pilleri asked Logan Gold commented

GIS distribution logic

Hello, i'm trying to adapt one of the GIS Navigation logic found here to my model. Instead of having multiple factories that send the items to the closest warehouse, i have only one main factory that distributes the items to all the warehouses displayed on the map and i'm trying to write a custome code that respond to the demand of each warehouse and start the process. Can someone help me with the errors that are showing?copia modello mappa_autosave.fsm

FlexSim 24.2.0
gis navigatorcustomecode
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Logan Gold commented

What I found so far:

1) In the Custom Code after the Pull from List you initialize the array "flow" as an empty array and then try to set values. Which doesn't work since the array is still empty.

1727676822309.png

You can initialize it to the correct size and fill it with 0s in a single expression instead.

  1. Array flow = Array(demand.length).fill(0);


2) The created tokens should be children of the main token, not siblings, if they need to access labels on it. With that being said, as far as I you only access the main tokens labels to create the "Quant" label, which you could do in the Create Tokens activity already.

1727677050149.png


3) In the "Set Name" option of the Custom Code activity in the sub flow you use "item" instead of "Item" as the label name.


4) There are only 25 points linked to the Warehouse flow, so only 25 values can be pulled and the MinCostFlow label is running out of bounds for the 26th token. I didn't check which of the cities is missing.


1727676822309.png (7.8 KiB)
1727677050149.png (17.3 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.