The error message states what went wrong and, more importantly, where.
"Invalid row number: 22 in Global Table "GlobalTable2" -> something tried to read a value from the 22nd row in GlobalTable2 which doesn't exist.
"at MODEL:/Pintura>variables/setuptime" -> it happened in the code that determines the setup time of the Pintura processor.
You can then put a breakpoint into the relevant code shortly before the time the error happens and step through it to pinpoint the cause.
In this case, within the code you use the following section:
if (getinput(current)==1){//If first item
return Table("GlobalTable2")[item.Type][1]; // <- This causes the error
}
This uses the numerical Type label to access a row in the table instead of the text label. This did not lead to an error previously because the first item had type 1. The random type of the items is determined by using the random number stream "0" in your model. So something you changed causes this stream to get called additinal or fewer times, changing the order in which the values are assigned.
This is why it is generally recommended to use the "getstream(current)" function. It assigns each object a unique random number stream, so that adding additional objects that also use random numbers will not change anything about the random numbers of other objects, keeping model repeatability higher.
Statistics are always counted. The warmup time just resets them. The "Staytime by Type" chart is a bit special in that regard. The statistics table itself is not reset on the warmup, only the tracked variables the values are read from. So the chart will only change the next time each row (type) is updated. You can reset the chart as well by installing its components and adding the following event to the "Staytime By Type Collector" that will have been added to the toolbox.


modelo-situacao-agv-deck-lift-com-parametros_1.fsm
If you run an experiment in the Experimenter, you can view performance measures for all scenarios/replications, copy them to a different file from there or generate a html-report.
