During a parametersVariation experiment, the below code only writes the database from the last run to the desired excel sheet. How can I concatenate the data from each run into the same excel sheet?
Database myFile = new Database(this, "A DB from Excel", "DataExport.xlsx");
ModelDatabase modelDB = getEngine().getModelDatabase();
modelDB.exportToExternalDB("flowchart_stats_time_in_state_log", myFile.getConnection(), "Sheet", false, true);
You need to put the Excel file on the simulation page and have the export code execute after all the parameter runs have been completed. If you do this after each run it will overwrite all the data all the time.
Just a tip: You might want to consider adding in a column where you can identify the parameters run. Maybe a column for the parameter you are changing, as well as the seed or run number.