-
Notifications
You must be signed in to change notification settings - Fork 35
180 Change all multirun testing files to use multirun.jar -DBSetup
#187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3dce696
a982ac3
0cff4c2
6ca929c
85251c8
82a9fc2
f7f7bbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # FOR TESTING | ||
| # CONFIG FILE TO CREATE NEW DATABASE OBJECTS | ||
|
|
||
| # Arguments of the SimPathsMultiRun object overridden by the command-line | ||
| countryString: "United Kingdom" | ||
| executeWithGui: false | ||
| randomSeed: 606 | ||
| startYear: 2019 | ||
| endYear: 2030 | ||
| popSize: 40000 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # This file can be used to override defaults for multirun arguments. | ||
| # Arguments of the SimPathsMultiRun object overridden by the command-line | ||
|
|
||
| maxNumberOfRuns: 2 | ||
| executeWithGui: false | ||
| randomSeed: 100 | ||
| startYear: 2019 | ||
| endYear: 2022 | ||
| popSize: 20000 | ||
|
|
||
| collector_args: | ||
| persistStatistics: true | ||
| persistStatistics2: true | ||
| persistStatistics3: true | ||
| persistPersons: false | ||
| persistBenefitUnits: false | ||
| persistHouseholds: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| import java.util.*; | ||
|
|
||
| // import plug-in packages | ||
| import org.apache.commons.io.FileUtils; | ||
| import simpaths.data.startingpop.DataParser; | ||
| import simpaths.model.AnnuityRates; | ||
| import simpaths.model.enums.*; | ||
|
|
@@ -1907,7 +1908,19 @@ private static void calculatePopulationGrowthRatiosFromProjections() { | |
|
|
||
| public static TreeMap<Integer, String> calculateEUROMODpolicySchedule(Country country) { | ||
| //Load current values for policy description and initiation year | ||
| MultiKeyCoefficientMap currentEUROMODpolicySchedule = ExcelAssistant.loadCoefficientMap("input" + File.separator + EUROMODpolicyScheduleFilename + ".xlsx", country.toString(), 1, 3); | ||
| MultiKeyCoefficientMap currentEUROMODpolicySchedule; | ||
|
|
||
| if (trainingFlag) { | ||
| File trainingSchedule = new File("input" + File.separator + "EUROMODoutput" + File.separator + "training" + File.separator + EUROMODpolicyScheduleFilename + ".xlsx"); | ||
| File runSchedule = new File("input" + File.separator + EUROMODpolicyScheduleFilename + ".xlsx"); | ||
| try { | ||
| FileUtils.copyFile(trainingSchedule, runSchedule); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just noticed that this will always copy the policy schedule if training flag is true. So this scenario is possible:
Ideally, the training policy schedule file should always be loaded automatically at the very start if only training data is available, and this step should only occur before the user specifies the file. Or, this file never gets used and if the policy schedule file doesn't match it checks and errors out? |
||
| } catch (IOException e) { | ||
| System.err.println("Could not replace EUROMODoutput.xlsx from training data"); | ||
| } | ||
| } | ||
|
|
||
| currentEUROMODpolicySchedule = ExcelAssistant.loadCoefficientMap("input" + File.separator + EUROMODpolicyScheduleFilename + ".xlsx", country.toString(), 1, 3); | ||
| TreeMap<Integer, String> newEUROMODpolicySchedule = new TreeMap<>(); | ||
|
|
||
| for(Object o: currentEUROMODpolicySchedule.keySet()) { | ||
|
|
@@ -3318,6 +3331,11 @@ public static void databaseSetup(Country country, boolean executeWithGui, int st | |
| String filePath = "./input" + File.separator + "input.mv.db"; | ||
| safeDelete(filePath); | ||
|
|
||
| // Detect if data available; set to testing data if not | ||
| Collection<File> testList = FileUtils.listFiles(new File(Parameters.getInputDirectoryInitialPopulations()), new String[]{"csv"}, false); | ||
| if (testList.size()==0) | ||
andrewbaxter439 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Parameters.setTrainingFlag(true); | ||
|
|
||
andrewbaxter439 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // populate new database for starting data | ||
| DataParser.databaseFromCSV(country, executeWithGui); // Initial database tables | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.