Search code examples
excelparameterssimulationanylogic

Reading Parameters row by row from excel for Anylogic Experiment


I want to run an Anylogic Parameter experiment, and I want the parameters to be read continuously from an excel file such that each row of excel data corresponds to parameters of one run. Likewise I want it to run as many times as rows of parameters in excel. I am able to read one row data using ExcelControlName.getCellNumericValue("ExcelSheetName", RowNumber, ColNumber) but how do I set it up such that it automatically runs multiple times by running parameters from all rows.


Solution

  • in your simulation model, create a parameter called row, and this will be the ONLY parameter that changes in your parameter variation experiment... then you will transform your parameters in your simulation to variables, and each variable will read the excel file as follows>

    ExcelControlName.getCellNumericValue("ExcelSheetName", row, ColNumber)
    

    where row, is the parameter that changes in your parameter variation experiment, and colNumber is the column representing the particular variable that you want to assess.