question

Sri_vikas K avatar image
0 Likes"
Sri_vikas K asked Felix Möhlmann answered

Routing connection Notworking for one node.

Hi flexsim community,
I am creating GIS points using the code below and establishing connection between the locations if the cell value in connections table is 1. example, if the cell value in [CO_Station_1][Plant] is 1 then I will establish connection between those two points. It is actually working for the CO_Station_2 but what is happening with CO_Station_1? unable to trace it!


Thanks in advance.


GIS System routing.fsm

FlexSim 23.0.15
gisrouting
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

With how you have structured the tables, using the row and column numbers as indexes in the "GISPoints" array doesn't make sense. When row and column number are the same you are connecting a point to itself.

You need to translate the row/column header into the correct array index (which is equal to the row where the header appears in the "Locations" table).

if (routes[i][j] == 1) {
                 
            string rowHeader = routes.getRowHeader(i);             string colHeader = routes.getColHeader(j);                         int indexRow = points.getRowByKey(rowHeader, 1);             int indexCol = points.getRowByKey(colHeader, 1);             contextdragconnection (GISPoints[indexRow], GISPoints[indexCol], "A");         }
5 |100000

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