Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,5 @@ input/EUROMODoutput/baseline/*

# IntelliJ
.idea/

input/InitialPopulations/original/*
Binary file modified input/DatabaseCountryYear.xlsx
Binary file not shown.
Binary file modified input/EUROMODpolicySchedule.xlsx
Binary file not shown.
75,317 changes: 37,823 additions & 37,494 deletions input/InitialPopulations/training/population_initial_UK_2019.csv

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import microsim.statistics.ICollectionFilter;
import simpaths.model.Person;
import simpaths.model.enums.Education;
import simpaths.model.enums.Les_c4;
import simpaths.model.enums.Region;

public class RegionEducationAtRiskOfWorkCSfilter implements ICollectionFilter{
Expand All @@ -19,7 +20,11 @@ public RegionEducationAtRiskOfWorkCSfilter(Region demRgn, Education education) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education) && person.atRiskOfWork());
if (person.getDeh_c4()==null) {
return false;
} else {
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education) && person.atRiskOfWork());
}
}
else throw new IllegalArgumentException("Object passed to RegionEducationCSfilter must be of type Person!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ public RegionEducationCSfilter(Region demRgn, Education education) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education));
if (person.getDeh_c4()==null) {
return false;
} else {
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education));
}
}
else throw new IllegalArgumentException("Object passed to RegionEducationCSfilter must be of type Person!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ public RegionEducationWorkingCSfilter(Region demRgn, Education education) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education) && person.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed) && person.getGrossEarningsYearly() >= 0.);
if (person.getDeh_c4()==null || person.getLes_c4()==null) {
return false;
} else {
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education) && person.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed) && person.getGrossEarningsYearly() >= 0.);
}
}
else throw new IllegalArgumentException("Object passed to RegionEducationWorkingCSfilter must be of type Person!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import simpaths.model.enums.Les_c4;
import microsim.statistics.ICollectionFilter;

import java.util.Objects;

/*
This filter is like an age group filter, but only selects individuals who are not Students

Expand All @@ -22,7 +24,11 @@ public ValidEducationAgeGroupCSfilter(int ageFrom, int ageTo) {

public boolean isFiltered(Object object) {
Person person = (Person) object;
return ( (person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) && !person.getLes_c4().equals(Les_c4.Student));
if (person.getLes_c4()==null) {
return false;
} else {
return ( (person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) && !person.getLes_c4().equals(Les_c4.Student));
}
}

public int getAgeFrom() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public ValidEducationRegionCSfilter(Region demRgn) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
return (person.getRegion().equals(demRgn) && !person.getLes_c4().equals(Les_c4.Student) && person.getDemAge() >= 18 && person.getDeh_c4() != null);
if (person.getLes_c4()==null) {
return false;
} else {
return (person.getRegion().equals(demRgn) && !person.getLes_c4().equals(Les_c4.Student) && person.getDemAge() >= 18 && person.getDeh_c4() != null);
}
}
else if(object instanceof BenefitUnit) {
BenefitUnit benefitUnit = (BenefitUnit) object;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/simpaths/data/statistics/Statistics2.java
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,13 @@ else if ((double)person.getLabourSupplyHoursWeekly() > 1.0)

invInc[ii] += person.getBenefitUnit().getInvestmentIncomeAnnual() / 12.0 / es;
penInc[ii] += person.getBenefitUnit().getPensionIncomeAnnual() / 12.0 / es;
disInc[ii] += person.getBenefitUnit().getDisposableIncomeMonthly() / es;
disInc[ii] += person.getBenefitUnit().getDisposableIncomeMonthlyNoNull() / es;
if (person.getBenefitUnit().getInvestmentIncomeAnnual()<0.0) {
invLosses[ii] += person.getBenefitUnit().getInvestmentIncomeAnnual() / 12.0 / es;
grossDisInc[ii] += (person.getBenefitUnit().getDisposableIncomeMonthly() -
grossDisInc[ii] += (person.getBenefitUnit().getDisposableIncomeMonthlyNoNull() -
person.getBenefitUnit().getInvestmentIncomeAnnual() / 12.0) / es;
} else {
grossDisInc[ii] += person.getBenefitUnit().getDisposableIncomeMonthly() / es;
grossDisInc[ii] += person.getBenefitUnit().getDisposableIncomeMonthlyNoNull() / es;
}
double expenditurePerMonth = person.getBenefitUnit().getDiscretionaryConsumptionPerYear(false) / 12.0 +
person.getBenefitUnit().getChildcareCostPerWeek(false) * Parameters.WEEKS_PER_MONTH +
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/simpaths/experiment/SimPathsCollector.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ private class Ydses_c5 implements IDoubleSource {
public void update() {

//Ydses_c5
householdsGrossIncomesCS = new CrossSection.Double(model.getBenefitUnits(), BenefitUnit.class, "getTmpHHYpnbihs_dv_asinh", true); //Populate CS
householdsGrossIncomesCS = new CrossSection.Double(model.getBenefitUnits(), BenefitUnit.class, "getTmpHHYpnbihs_dv_asinhNoNull", true); //Populate CS

percentileFunctionHouseholdsGrossIncomes = new PercentileArrayFunction(householdsGrossIncomesCS); //Get p50
percentileFunctionHouseholdsGrossIncomes.updateSource();
Expand Down Expand Up @@ -862,6 +862,14 @@ public void setPersistStatistics2(boolean val) {
persistStatistics2 = val;
}

public boolean isPersistAlignmentAdjustmentFactors() {
return persistAlignmentAdjustmentFactors;
}

public void setPersistAlignmentAdjustmentFactors(boolean val) {
persistAlignmentAdjustmentFactors = val;
}

public void calculateAtRiskOfPoverty() {
calculateEquivalisedHouseholdDisposableIncome();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/simpaths/experiment/SimPathsObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -1527,10 +1527,10 @@ else if(edu.equals(Education.High)) {
}
for (Gender gender : Gender.values()) {
GenderEducationWorkingCSfilter genderEducationWorkingFilter = new GenderEducationWorkingCSfilter(gender, edu);
Weighted_CrossSection.Double DispIncWorkingCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getDisposableIncomeMonthly", true); // Note: these are nominal values for each simulated year
Weighted_CrossSection.Double DispIncWorkingCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getDisposableIncomeMonthlyNoNull", true); // Note: these are nominal values for each simulated year
DispIncWorkingCS.setFilter(genderEducationWorkingFilter);
GenderEducationCSfilter genderEducationCSfilter = new GenderEducationCSfilter(gender, edu);
Weighted_CrossSection.Double DispIncAllCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getDisposableIncomeMonthly", true); // Note: these are nominal values for each simulated year
Weighted_CrossSection.Double DispIncAllCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getDisposableIncomeMonthlyNoNull", true); // Note: these are nominal values for each simulated year
DispIncAllCS.setFilter(genderEducationCSfilter);
DispIncByGenderAndEducationPlotter.addSeries("Workers (" + gender.toString() + ", " + edu.toString() + ")", new Weighted_MeanArrayFunction(DispIncWorkingCS), null, colorArrayList.get(colorCounter), false);
colorCounter++;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/simpaths/experiment/SimPathsStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ private static void chooseCountryAndStartYear() {
String text = "<html><h2 style=\"text-align: center; font-size:120%;\">Select simulation start year</h2>";

// sizing for GUI
int height = 280, width = 600;
int height = 220, width = 600;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
if (screenSize.width < 850) {
width = (int) (screenSize.width * 0.95);
Expand Down
Loading
Loading