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.

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.

Ludovica Pilleri avatar image Ludovica Pilleri commented ·

final map model distribution italy.fsmThank you so much! It's finally working even though the trucks aren't displayed yet on the Map. Could you explain me why? Thank you

0 Likes 0 ·
Logan Gold avatar image Logan Gold ♦♦ Ludovica Pilleri commented ·
There's a weird behavior sometimes when trying to connect/disconnect Task Executers like Trucks to/from points on a GIS map. For some reason, the Trucks will show up as white squares.


I don't know why it happens, and I haven't been able to figure out a workaround yet for this model. But I do see in your other post that you are using the same logic, but the Truck shape does show up. Is the model in that post a newer model? If so, do you know what changes were made between the two iterations?

Or is the post in this model newer? In which case, do you know what changes were made between when it was showing the trucks and when they started showing up as white squares?

0 Likes 0 ·