Apparently, Table.sort is not stable (see the video attached):
How to reproduce: create a global table GlobalTable1 and run this script:
Table t = Table("GlobalTable1"); t.setSize(20, 4); for (int i = 1; i <= t.numRows; i++) { t[i][1] = 0; t[i][2] = uniform(0, 1000); t[i][3] = uniform(0, 1000); t[i][4] = uniform(0, 1000); } t.setColHeader(1, "Time"); t.setColHeader(2, "A"); t.setColHeader(3, "B"); t.setColHeader(4, "C");
Each time you call
Table("GlobalTable1").sort("Time")
the order of rows in the global table will be different.
So, if you call Table.sort on Reset, and the order of rows impacts simulation, then the results will be different each time you run this simulation.
Why it matters: If Table.sort is not stable, then simulation results may change according to how many times it is called. This may be an issue if input or configuration data have to be sorted on reset or during simulation run, because each subsequent reset and run will produce different results. So simulation results are not reproducible if Table.sort is used (FlexSim has to be restarted to reproduce the first simulation run).