Reputation: 83
I have an excel sheet that import data into my anylogic model database. Is there any way to have the simulation start time to be coded to look at what day/time is in the database to start the simulation.
Upvotes: 1
Views: 360
Reputation: 972
From the internal AnyLogic database you can just retrieve it during initial experiment setup and use it to modify the model start date with the following code:
getExperiment().getEngine().setStartDate(selectFrom(mytable).firstResult(mytable.mycolumn));
Here is an example of the date value stored in the internal database, that fits to the code above:
The only thing to look out for might be the order of initialization. It might be that the query for the date form the internal database happens before the internal database is automatically updated from the Excel file. In this case you should directly query from the Excel file, not from the internal database.
Upvotes: 3