Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
21204a0
gui: fix `ConversionException` on `UnionMatchingMethod`
amorison Aug 20, 2026
4be2ad0
bump jasmine to 5.2.0
amorison Aug 25, 2026
fb1192a
add `Filters::youngerStrict`
amorison Aug 3, 2026
ca529c1
add more filters, marking corresponding older API for removal
amorison Aug 4, 2026
8620f57
add more filters, marking corresponding older API for removal
amorison Aug 4, 2026
c15a33e
EmploymentHistoryFilterTest: use `Filters.employmentHistory`
amorison Aug 10, 2026
f11271e
`EmploymentStatisticsTest`: actually test `EmploymentStatistics`
amorison Aug 10, 2026
d17bce9
`EmploymentStatistics`: use new statistics api
amorison Aug 10, 2026
365662c
WellbeingByGender: use new statistics API
amorison Aug 25, 2026
a0cf1d8
SimPathsCollector: use new statistics API
amorison Aug 10, 2026
21259e3
replace `FertileFilter` with `Filters.fertile`
amorison Aug 11, 2026
9283785
SimPathsObserver: delete commented out code
amorison Aug 11, 2026
36dcf96
SimPathsObserver: rm unused variables
amorison Aug 11, 2026
4c80829
Person: rm unused series `yDispEquivYear` & `xEquivYearL1`
amorison Aug 12, 2026
1d4c967
SimPathsCollector: use new supplier API for gini coeff
amorison Aug 12, 2026
e540f8e
SimPathsObserver: use qualified imports
amorison Aug 17, 2026
28f70e5
observer: use supplier API for employment rates
amorison Aug 17, 2026
0aa35ea
Observer: use supplier API for wellbeing plots
amorison Aug 17, 2026
c4fd7db
observer: extract `ageGenderPlots`
amorison Aug 17, 2026
6ca6146
observer: use `ageGenderPlots` for health plots
amorison Aug 17, 2026
02cb81c
observer: use `Supplier` API for more health plots
amorison Aug 17, 2026
987d7cb
observer: use `Supplier` API for eduction by age plots
amorison Aug 17, 2026
299da22
Parameters: abstract access to validation data
amorison Aug 18, 2026
a0243f2
observer: use new validation API in `AgeRange`
amorison Aug 18, 2026
9200d4e
observer: use `Supplier` API for health score plots
amorison Aug 18, 2026
0f396fb
ageGenderPlots takes `ageRanges` as argument
amorison Aug 18, 2026
06e8580
observer: use `ageGenderPlots` for health plots
amorison Aug 18, 2026
3e614f3
observer: use `Supplier` API for distribution by age plots
amorison Aug 18, 2026
2301af2
observer: rm stale comments
amorison Aug 18, 2026
558518c
observer: use supplier API for maternity employment plots
amorison Aug 18, 2026
67eda9e
observer: use supplier API for age pyramid
amorison Aug 18, 2026
6b51aa1
observer: use supplier API for pop size and n households plots
amorison Aug 18, 2026
3b251b9
observer: `meanPotentialEarningsMultiMap` use Supplier API
amorison Aug 18, 2026
cac48d2
observer: activity status plot uses supplier API
amorison Aug 18, 2026
59a1e8e
observer: use supplier API for more plots
amorison Aug 18, 2026
dce4ec1
observer: edu by region plots use supplier API
amorison Aug 18, 2026
d52f2fe
observer: more plots use supplier API
amorison Aug 18, 2026
1bc5d03
extract `Filters.flexibleLabourSupply`
amorison Aug 18, 2026
85f1996
observer: earnings plots use supplier API
amorison Aug 18, 2026
9b0c402
observer: use supplier API for remaning plots
amorison Aug 18, 2026
944c9c4
Validator: no longer implement `IDoubleSource`
amorison Aug 18, 2026
afdd923
rm unused filters
amorison Aug 18, 2026
56afe3e
Parameters: rm validation methods directly exposing mappings
amorison Aug 18, 2026
ac6a481
collector: drop unused `IDoubleSource` impl for gini coeff
amorison Aug 19, 2026
c779d2c
collector: minor comment clean up
amorison Aug 19, 2026
ce54bbc
bypass `AccumulatorStats` to collect gini coeff
amorison Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<dependency>
<groupId>com.github.jasmineRepo</groupId>
<artifactId>JAS-mine-core</artifactId>
<version>5.1.0</version>
<version>5.2.0</version>
<scope>compile</scope>
</dependency>
<!-- Modern replacement for xmlParserAPIs -->
Expand Down
205 changes: 150 additions & 55 deletions src/main/java/simpaths/data/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -2272,114 +2272,209 @@ public static LinearRegression getRegChildcareC1b() {
return regChildcareC1b;
}

///////////////////////////////////////////GETTERS FOR VALIDATION///////////////////////////////////////////////////
public static MultiKeyCoefficientMap getValidationStudentsByAge() {
return validationStudentsByAge;
// Access validation data
private static double nanIfNull(MultiKeyCoefficientMap map, int year, String label) {
// FIXME: why year-1?
var val = (Number) map.getValue(year - 1, label);
if (val == null) {
return Double.NaN;
}
return val.doubleValue();
}

private static String ageStr(int from, int to) {
return from + "_" + to;
}

private static String genderStr(Gender gender) {
return switch (gender) {
case Female -> "female";
case Male -> "male";
};
}

public static MultiKeyCoefficientMap getValidationStudentsByRegion() {
return validationStudentsByRegion;
private static String eduStr(Education education) {
return switch (education) {
case Low -> "dehc3_low";
case Medium -> "dehc3_med";
case High -> "dehc3_high";
case InEducation -> "dehc3_ineducation";
};
}

public static MultiKeyCoefficientMap getValidationEducationLevel() {
return validationEducationLevel;
private static String eduLevelStr(EducationLevel level) {
return switch (level) {
case Low -> "low";
case Medium -> "med";
case High -> "high";
};
}

public static MultiKeyCoefficientMap getValidationEducationLevelByAge() {
return validationEducationLevelByAge;
public static double validationStudents(int year) {
return nanIfNull(validationStudentsByAge, year, "ageGroup_All");
}

public static MultiKeyCoefficientMap getValidationEducationLevelByRegion() {
return validationEducationLevelByRegion;
public static double validationStudents(int year, int ageFrom, int ageTo) {
var label = String.join("_", "ageGroup", ageStr(ageFrom, ageTo));
return nanIfNull(validationStudentsByAge, year, label);
}

public static MultiKeyCoefficientMap getValidationPartneredShareByRegion() {
return validationPartneredShareByRegion;
public static double validationStudents(int year, Region region) {
var label = String.join("_", "region", region.name());
return nanIfNull(validationStudentsByRegion, year, label);
}

public static MultiKeyCoefficientMap getValidationDisabledByAge() {
return validationDisabledByAge;
public static double validationEduc(int year, EducationLevel level) {
var label = String.join("_", "educ", eduLevelStr(level));
return nanIfNull(validationEducationLevel, year, label);
}

public static MultiKeyCoefficientMap getValidationDisabledByGender() {
return validationDisabledByGender;
public static double validationEduc(int year, EducationLevel level, int ageFrom, int ageTo) {
var label = String.join("_", "educ", eduLevelStr(level), ageStr(ageFrom, ageTo));
return nanIfNull(validationEducationLevelByAge, year, label);
}

public static MultiKeyCoefficientMap getValidationHealthByAge() {
return validationHealthByAge;
public static double validationEduc(int year, EducationLevel level, Region region) {
var label = String.join("_", "educ", eduLevelStr(level), region.name());
return nanIfNull(validationEducationLevelByRegion, year, label);
}

public static MultiKeyCoefficientMap getValidationMentalHealthByAge() {
return validationMentalHealthByAge;
public static double validationPartnered(int year) {
var label = String.join("_", "partnered", "All");
return nanIfNull(validationPartneredShareByRegion, year, label);
}

public static MultiKeyCoefficientMap getValidationHealthMCSByAge() {
return validationHealthMCSByAge;
public static double validationPartnered(int year, Region region) {
var label = String.join("_", "partnered", region.name());
return nanIfNull(validationPartneredShareByRegion, year, label);
}

public static MultiKeyCoefficientMap getValidationHealthPCSByAge() {
return validationHealthPCSByAge;
public static double validationDisabled(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "disabled", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationDisabledByAge, year, label);
}

public static MultiKeyCoefficientMap getValidationLifeSatisfactionByAge() {
return validationLifeSatisfactionByAge;
public static double validationDisabled(int year, Gender gender) {
var label = String.join("_", "dlltsd", genderStr(gender));
return nanIfNull(validationDisabledByGender, year, label);
}

public static double validationHealth(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "health", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationHealthByAge, year, label);
}

public static double validationMentalHealth(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "mental_health", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationMentalHealthByAge, year, label);
}

public static MultiKeyCoefficientMap getValidationPsychDistressByAge() {
return validationPsychDistressByAge;
public static double validationHealthMcs(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "health_mcs_score", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationHealthMCSByAge, year, label);
}

public static MultiKeyCoefficientMap getValidationPsychDistressByAgeLow() {
return validationPsychDistressByAgeLow;
public static double validationHealthPcs(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "health_pcs_score", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationHealthPCSByAge, year, label);
}

public static MultiKeyCoefficientMap getValidationPsychDistressByAgeMed() {
return validationPsychDistressByAgeMed;
public static double validationLifeSatisfaction(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "life_satisfaction", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationLifeSatisfactionByAge, year, label);
}

public static MultiKeyCoefficientMap getValidationPsychDistressByAgeHigh() {
return validationPsychDistressByAgeHigh;
public static double validationPsychDistress(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "psych_distress", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationPsychDistressByAge, year, label);
}

public static MultiKeyCoefficientMap getValidationEmploymentByGender() {
return validationEmploymentByGender;
public static double validationPsychDistressLow(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "psych_distress", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationPsychDistressByAgeLow, year, label);
}

public static MultiKeyCoefficientMap getValidationEmploymentByAgeAndGender() {
return validationEmploymentByAgeAndGender;
public static double validationPsychDistressMed(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "psych_distress", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationPsychDistressByAgeMed, year, label);
}

public static MultiKeyCoefficientMap getValidationEmploymentByMaternity() {
return validationEmploymentByMaternity;
public static double validationPsychDistressHigh(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "psych_distress", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationPsychDistressByAgeHigh, year, label);
}

public static MultiKeyCoefficientMap getValidationEmploymentByGenderAndRegion() {
return validationEmploymentByGenderAndRegion;
public static double validationEmployment(int year, Gender gender) {
// this one has a different gender label than others...
var label = String.join("_", "employed", gender.name());
return nanIfNull(validationEmploymentByGender, year, label);
}

public static MultiKeyCoefficientMap getValidationLabourSupplyByEducation() {
return validationLabourSupplyByEducation;
public static double validationEmployment(int year, Gender gender, int ageFrom, int ageTo) {
var label = String.join("_", "employed", genderStr(gender), ageStr(ageFrom, ageTo));
return nanIfNull(validationEmploymentByAgeAndGender, year, label);
}

public static MultiKeyCoefficientMap getValidationActivityStatus() {
return validationActivityStatus;
// FIXME: enum for maternity state
public static double validationEmployment(int year, boolean withChild, boolean childIsInfant) {
String chStr;
if (withChild) {
if (childIsInfant) {
chStr = "with_child_0_5";
} else {
chStr = "with_child_6_18";
}
} else {
chStr = "without_child";
}
var label = String.join("_", "emp", chStr);
return nanIfNull(validationEmploymentByMaternity, year, label);
}

public static double validationEmployment(int year, Gender gender, Region region) {
var label = String.join("_", "employed", genderStr(gender), region.name());
return nanIfNull(validationEmploymentByGenderAndRegion, year, label);
}

public static double validationLabourSupply(int year, Education education) {
// this one has a different education label than others...
var label = String.join("_", "labour_supply", education.name());
return nanIfNull(validationLabourSupplyByEducation, year, label);
}

// FIXME: enum for status
/// `status` can be `"employed"`, `"notemployedretired"`, `"student"`
public static double validationActivityStatus(int year, String status) {
var label = String.join("_", "as", status);
return nanIfNull(validationActivityStatus, year, label);
}

public static double validationHomeOwnership(int year) {
var val = (Number) validationHomeownershipBenefitUnits.getValue(year - 1);
if (val == null) {
return Double.NaN;
}
return val.doubleValue();
}

public static MultiKeyCoefficientMap getValidationHomeownershipBenefitUnits() {
return validationHomeownershipBenefitUnits;
public static double validationGrossEarnings(int year, Gender gender, Education education) {
var label = String.join("_", "grossearnings", genderStr(gender), eduStr(education));
return nanIfNull(validationGrossEarningsByGenderAndEducation, year, label);
}

public static MultiKeyCoefficientMap getValidationGrossEarningsByGenderAndEducation() {
return validationGrossEarningsByGenderAndEducation;
public static double validationLhw(int year, Gender gender) {
var label = String.join("_", "lhw", genderStr(gender));
return nanIfNull(validationLhwByGenderAndEducation, year, label);
}

public static MultiKeyCoefficientMap getValidationLhwByGenderAndEducation() {
return validationLhwByGenderAndEducation;
public static double validationLhw(int year, Gender gender, Education education) {
var label = String.join("_", "lhw", genderStr(gender), eduStr(education));
return nanIfNull(validationLhwByGenderAndEducation, year, label);
}

public static MultiKeyCoefficientMap getHourlyWageByGenderAndEducation() {
return hourlyWageByGenderAndEducation;
public static double validationHourlyWage(int year, Gender gender, Education education) {
var label = String.join("_", "hourlywage", genderStr(gender), eduStr(education));
return nanIfNull(hourlyWageByGenderAndEducation, year, label);
}

///////////////////////////////////////////GETTERS FOR COVID-19 LABOUR TRANSITIONS//////////////////////////////////
Expand Down
33 changes: 0 additions & 33 deletions src/main/java/simpaths/data/filters/AgeGenderCSfilter.java

This file was deleted.

30 changes: 0 additions & 30 deletions src/main/java/simpaths/data/filters/AgeGroupCSfilter.java

This file was deleted.

27 changes: 27 additions & 0 deletions src/main/java/simpaths/data/filters/BenefitUnitFilters.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package simpaths.data.filters;

import java.util.function.Predicate;

import simpaths.model.BenefitUnit;
import simpaths.model.enums.Occupancy;
import simpaths.model.enums.Region;

/// Collection of [BenefitUnit] filters.
public class BenefitUnitFilters {
BenefitUnitFilters() {}

/// Filter by region.
public static Predicate<BenefitUnit> region(Region region) {
return b -> b.getRegion() == region;
}

/// Filter by occupancy.
public static Predicate<BenefitUnit> occupancy(Occupancy occupancy) {
return b -> b.getOccupancy() == occupancy;
}

/// Filter benefit units with a non-negative disposable income.
public static Predicate<BenefitUnit> validIncome() {
return b -> b.getEquivalisedDisposableIncomeYearly() >= 0.0;
}
}
22 changes: 0 additions & 22 deletions src/main/java/simpaths/data/filters/CanBePartneredCSfilter.java

This file was deleted.

Loading
Loading