Skip to content

Commit b9348ff

Browse files
authored
Merge pull request simpaths#300 from andrewbaxter439/experimental/define-integration-test-folder
Experimental/define integration test folder
2 parents 512d595 + 76c19e9 commit b9348ff

8 files changed

Lines changed: 87 additions & 62 deletions

File tree

config/test_run.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ randomSeed: 100
77
startYear: 2019
88
endYear: 2022
99
popSize: 20000
10+
integrationTest: true
1011

1112
collector_args:
1213
persistStatistics: true

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
<dependency>
115115
<groupId>com.github.jasmineRepo</groupId>
116116
<artifactId>JAS-mine-core</artifactId>
117-
<version>4.3.15</version>
117+
<version>4.3.23b.9000</version>
118118
<scope>compile</scope>
119119
</dependency>
120120
<dependency>

src/main/java/simpaths/experiment/SimPathsMultiRun.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// import Java packages
55
import org.apache.log4j.Level;
66
import org.apache.commons.cli.*;
7+
import org.apache.commons.io.FileUtils;
78
import org.yaml.snakeyaml.Yaml;
89
import java.io.FileInputStream;
910
import java.io.FileNotFoundException;
@@ -62,6 +63,8 @@ public class SimPathsMultiRun extends MultiRun {
6263
private static boolean persist_population;
6364
private static boolean persist_root;
6465

66+
private static boolean integrationTest = false;
67+
6568
/**
6669
*
6770
* MAIN PROGRAM ENTRY FOR MULTI-SIMULATION
@@ -130,6 +133,27 @@ public static void main(String[] args) {
130133
engine.setExperimentBuilder(experimentBuilder);
131134
engine.setup(); //This is needed to update model attributes (from model_args in config file)
132135

136+
137+
if (integrationTest) {
138+
139+
String integrationOutputFolder = "./output" + File.separator + "INTEGRATION_TESTS";
140+
141+
Experiment.testOutputFolder = integrationOutputFolder;
142+
143+
144+
try {
145+
146+
if (FileUtils.isDirectory(new File(integrationOutputFolder))) {
147+
FileUtils.deleteDirectory(new File(integrationOutputFolder));
148+
}
149+
150+
} catch (IOException e) {
151+
throw new RuntimeException(e);
152+
}
153+
154+
Parameters.setTrainingFlag(true);
155+
}
156+
133157
if (executeWithGui)
134158
new MultiRunFrame(experimentBuilder, "SimPaths MultiRun", maxNumberOfRuns);
135159
else
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
run,time,id_EmploymentStatistics1,EmpToNotEmp,NotEmpToEmp,PropEmployed,PropUnemployed,
2-
1,2019.0,1,0.07657975099835565,0.49482312338222606,0.7276956305034059,0.13648446585811597,
3-
1,2020.0,1,0.010929577464788733,0.31957547169811323,0.7674669768214671,0.09869568829442552,
4-
1,2021.0,1,0.011645299145299146,0.21739130434782608,0.7767523073085557,0.09162717219589257,
5-
1,2022.0,1,0.016505466778805718,0.20640569395017794,0.7801081980857262,0.08722430295464004,
6-
2,2019.0,1,0.07657975099835565,0.49482312338222606,0.7276956305034059,0.13648446585811597,
7-
2,2020.0,1,0.010929577464788733,0.31957547169811323,0.7674669768214671,0.09869568829442552,
8-
2,2021.0,1,0.011645299145299146,0.21739130434782608,0.7767523073085557,0.09162717219589257,
9-
2,2022.0,1,0.016505466778805718,0.20640569395017794,0.7801081980857262,0.08722430295464004,
1+
run,time,id_EmploymentStatistics1,EmpToNotEmp,NotEmpToEmp,PropEmployed,PropUnemployed
2+
1,2019.0,1,0.07657975099835565,0.49482312338222606,0.7276956305034059,0.13648446585811597
3+
1,2020.0,1,0.010929577464788733,0.31957547169811323,0.7674669768214671,0.09869568829442552
4+
1,2021.0,1,0.011645299145299146,0.21739130434782608,0.7767523073085557,0.09162717219589257
5+
1,2022.0,1,0.016505466778805718,0.20640569395017794,0.7801081980857262,0.08722430295464004
6+
2,2019.0,1,0.07657975099835565,0.49482312338222606,0.7276956305034059,0.13648446585811597
7+
2,2020.0,1,0.010929577464788733,0.31957547169811323,0.7674669768214671,0.09869568829442552
8+
2,2021.0,1,0.011645299145299146,0.21739130434782608,0.7767523073085557,0.09162717219589257
9+
2,2022.0,1,0.016505466778805718,0.20640569395017794,0.7801081980857262,0.08722430295464004

src/test/java/simpaths/integrationtest/expected/HealthStatistics1.csv

Lines changed: 25 additions & 25 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
run,time,id_Statistics1,edi_p50,giniEquivalisedHouseholdDisposableIncomeNational,giniMarketIncomeNational,grossLabourIncome_p20,grossLabourIncome_p40,grossLabourIncome_p60,grossLabourIncome_p80,medianEquivalisedHouseholdDisposableIncome,sIndex_p50,ydses_p20,ydses_p40,ydses_p60,ydses_p80,
2-
1,2019.0,1,13095.307851314308,0.0,0.0,973.4096725036837,1525.932657685651,2158.2741367617946,3228.276924267956,13095.307851314308,NaN,0.0,4.858943553994427,7.849675860587956,8.375850062998584,
3-
1,2020.0,1,15575.722944710858,0.0,0.0,1181.5608933150663,1747.6557506385611,2421.8789326058222,3469.277972897026,15564.82710517697,NaN,0.0,7.074433470218817,8.020759494695893,8.504765831925205,
4-
1,2021.0,1,16113.258882190123,0.0,0.0,1273.1333164859516,1866.7122771619715,2517.1508140543865,3606.7262455727155,16106.24011323231,NaN,0.0,7.277018560662857,8.093902718239285,8.557598702286088,
5-
1,2022.0,1,16090.047149617112,0.0,0.0,1280.1333935903701,1866.018980405856,2531.202527148557,3627.2081348233537,16089.736327524866,NaN,0.0,7.2572637515703775,8.08880530015257,8.577949944032026,
6-
2,2019.0,1,13095.307851314308,0.0,0.0,973.4096725036837,1525.932657685651,2158.2741367617946,3228.276924267956,13095.307851314308,NaN,0.0,4.858943553994427,7.849675860587956,8.375850062998584,
7-
2,2020.0,1,15575.722944710858,0.0,0.0,1181.5608933150663,1747.6557506385611,2421.8789326058222,3469.277972897026,15564.82710517697,NaN,0.0,7.074433470218817,8.020759494695893,8.504765831925205,
8-
2,2021.0,1,16113.258882190123,0.0,0.0,1273.1333164859516,1866.7122771619715,2517.1508140543865,3606.7262455727155,16106.24011323231,NaN,0.0,7.277018560662857,8.093902718239285,8.557598702286088,
9-
2,2022.0,1,16090.047149617112,0.0,0.0,1280.1333935903701,1866.018980405856,2531.202527148557,3627.2081348233537,16089.736327524866,NaN,0.0,7.2572637515703775,8.08880530015257,8.577949944032026,
1+
run,time,id_Statistics1,edi_p50,giniEquivalisedHouseholdDisposableIncomeNational,giniMarketIncomeNational,grossLabourIncome_p20,grossLabourIncome_p40,grossLabourIncome_p60,grossLabourIncome_p80,medianEquivalisedHouseholdDisposableIncome,sIndex_p50,ydses_p20,ydses_p40,ydses_p60,ydses_p80
2+
1,2019.0,1,13095.307851314308,0.0,0.0,973.4096725036837,1525.932657685651,2158.2741367617946,3228.276924267956,13095.307851314308,NaN,0.0,4.858943553994427,7.849675860587956,8.375850062998584
3+
1,2020.0,1,15575.722944710858,0.0,0.0,1181.5608933150663,1747.6557506385611,2421.8789326058222,3469.277972897026,15564.82710517697,NaN,0.0,7.074433470218817,8.020759494695893,8.504765831925205
4+
1,2021.0,1,16113.258882190123,0.0,0.0,1273.1333164859516,1866.7122771619715,2517.1508140543865,3606.7262455727155,16106.24011323231,NaN,0.0,7.277018560662857,8.093902718239285,8.557598702286088
5+
1,2022.0,1,16090.047149617112,0.0,0.0,1280.1333935903701,1866.018980405856,2531.202527148557,3627.2081348233537,16089.736327524866,NaN,0.0,7.2572637515703775,8.08880530015257,8.577949944032026
6+
2,2019.0,1,13095.307851314308,0.0,0.0,973.4096725036837,1525.932657685651,2158.2741367617946,3228.276924267956,13095.307851314308,NaN,0.0,4.858943553994427,7.849675860587956,8.375850062998584
7+
2,2020.0,1,15575.722944710858,0.0,0.0,1181.5608933150663,1747.6557506385611,2421.8789326058222,3469.277972897026,15564.82710517697,NaN,0.0,7.074433470218817,8.020759494695893,8.504765831925205
8+
2,2021.0,1,16113.258882190123,0.0,0.0,1273.1333164859516,1866.7122771619715,2517.1508140543865,3606.7262455727155,16106.24011323231,NaN,0.0,7.277018560662857,8.093902718239285,8.557598702286088
9+
2,2022.0,1,16090.047149617112,0.0,0.0,1280.1333935903701,1866.018980405856,2531.202527148557,3627.2081348233537,16089.736327524866,NaN,0.0,7.2572637515703775,8.08880530015257,8.577949944032026

0 commit comments

Comments
 (0)