Skip to content
4 changes: 4 additions & 0 deletions src/main/java/simpaths/data/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ else if(numberOfChildren <= 5) {
public static final boolean USE_CONTINUOUS_LABOUR_SUPPLY_HOURS = true; // If true, a random number of hours of weekly labour supply within each bracket will be generated. Otherwise, each discrete choice of labour supply corresponds to a fixed number of hours of labour supply, which is the same for all persons
public static int maxAge; // maximum age possible in simulation
public static final int AGE_TO_BECOME_RESPONSIBLE = 18; // Age become reference person of own benefit unit
public static final int MIN_AGE_LEAVE_PH = 18; // Minimum age for a person to leave the parental home
public static int MAX_AGE_ADULT_CHILD; // Maximum age for a person to remain an adult child in the parental home
// after this age a person stop considering leaving p.h. and stops being an a.c.
public static final int MIN_AGE_TO_PROVIDE_CARE = 16; // Minimum age to provide social care
public static final int MIN_AGE_TO_LEAVE_EDUCATION = 16; // Minimum age for a person to leave (full-demYear) education
public static final int MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION = 29;
Expand Down Expand Up @@ -910,6 +913,7 @@ public static void loadParameters(Country country, int maxAgeModel, boolean enab
System.out.flush();

maxAge = maxAgeModel;
MAX_AGE_ADULT_CHILD = maxAge;
Comment on lines 915 to +916

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is intentional.

startYear = startYearModel;
endYear = endYearModel;

Expand Down
41 changes: 27 additions & 14 deletions src/main/java/simpaths/model/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ private void updateAgeGroup() {
public enum Processes {
Aging,
Cohabitation,
ConsiderLeavingHome,
ConsiderMortality,
ConsiderRetirement,
Fertility,
Expand Down Expand Up @@ -824,6 +825,9 @@ public void onEvent(Enum<?> type) {
case PartnershipDissolution -> {
partnershipDissolution();
}
case ConsiderLeavingHome -> {
considerLeavingHome();
}
case ConsiderMortality -> {
considerMortality();
}
Expand Down Expand Up @@ -1001,9 +1005,6 @@ private void aging() {
demAgeSq = demAge * demAge;
if (demAge == Parameters.AGE_TO_BECOME_RESPONSIBLE) {
setupNewBenefitUnit(true);
considerLeavingHome();
} else if (demAge > Parameters.AGE_TO_BECOME_RESPONSIBLE && Indicator.True.equals(demAdultChildFlag)) {
considerLeavingHome();
}
updateAgeGroup(); //Update ageGroup as person ages
}
Expand All @@ -1029,23 +1030,35 @@ private void considerMortality() {
//This process should be applied to those at the age to become responsible / leave home OR above if they have the adultChildFlag set to True (i.e. people can move out, but not move back in).
private void considerLeavingHome() {

//For those who are moving out, evaluate whether they should have stayed with parents and if yes, set the adultchildflag to true
//Age eligibility: only those within the age range to leave the parental home are considered
if (demAge < Parameters.MIN_AGE_LEAVE_PH || demAge > Parameters.MAX_AGE_ADULT_CHILD) {
return;
}

//Above the age to leave home, only those still living with their parents are considered (people can move out, but not move back in)
if (demAge > Parameters.MIN_AGE_LEAVE_PH && !Indicator.True.equals(demAdultChildFlag)) {
return;
}

//Those in continuous education are not allowed to leave home, to match the filtering condition of the estimated equation
if (Indicator.True.equals(eduSpellFlag)) {
demAdultChildFlag = Indicator.True;
return;
}

// Evaluate whether the person should leave the parental home:
// - if not, set demAdultChildFlag to true (remains living with parents)
// - if yes, set demAdultChildFlag to false and set up a new household

double prob = Parameters.getRegLeaveHomeP1a().getProbability(this, Person.DoublesVariables.class);
boolean toLeaveHome = (statInnovations.getDoubleDraw(21) < prob);
if (Les_c4.Student.equals(labC4)) {
if (!toLeaveHome) { //If at the age to leave home but regression outcome is negative, person has adultchildflag set to true (although they still set up a new benefitUnit in the simulation, it's treated differently in the labour supply)

demAdultChildFlag = Indicator.True; //Students not allowed to leave home to match filtering conditon
demAdultChildFlag = Indicator.True;
} else {

if (!toLeaveHome) { //If at the age to leave home but regression outcome is negative, person has adultchildflag set to true (although they still set up a new benefitUnit in the simulation, it's treated differently in the labour supply)

demAdultChildFlag = Indicator.True;
} else {

demAdultChildFlag = Indicator.False;
setupNewHousehold(); //If person leaves home, they set up a new household
}
demAdultChildFlag = Indicator.False;
setupNewHousehold(); //If person leaves home, they set up a new household
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/simpaths/model/SimPathsModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ public void buildSchedule() {
// Align the level of education if required
addEventToAllYears(Processes.EducationLevelAlignment);

// Check whether adult children leave the parental home - runs after education so that those in continuous education are excluded
yearlySchedule.addCollectionEvent(persons, Person.Processes.ConsiderLeavingHome);

// Homeownership status
yearlySchedule.addCollectionEvent(benefitUnits, BenefitUnit.Processes.Homeownership);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
run,time,id_AlignmentStatistics,empShareSimACFemales,empShareSimACMales,empShareSimCouples,empShareSimSingleDepFemales,empShareSimSingleDepMales,empShareSimSingleFemales,empShareSimSingleMales,empShareTgtACFemales,empShareTgtACMales,empShareTgtCouples,empShareTgtSingleDepFemales,empShareTgtSingleDepMales,empShareTgtSingleFemales,empShareTgtSingleMales,fertilityAdjFactor,fertilityRateSim,fertilityRateTgt,inSchoolAdjFactor,inSchoolShareSim,inSchoolShareTgt,partnershipAdjFactor,shareCohabitingSim,shareCohabitingTgt,utilityAdjACFemales,utilityAdjACMales,utilityAdjCouples,utilityAdjSingleDepFemales,utilityAdjSingleDepMales,utilityAdjSingleFemales,utilityAdjSingleMales
1,2019.0,1,0.5623931623931624,0.5619047619047619,0.8590878148400273,0.3333333333333333,0.44308943089430897,0.43822697265011,0.5445244410761653,0.5403293808853606,0.5311791259117856,0.8735970003111929,0.3943366638089926,0.465356415881109,0.4438849669010334,0.4705375056413739,0.0,0.05029585798816568,0.05113363440615968,0.0,0.281711358843025,0.3023858368396759,0.0,0.5387792565396972,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0
1,2020.0,1,0.4490644490644491,0.5430711610486891,0.9006183745583038,0.4628975265017668,0.4928571428571429,0.3298311444652908,0.42654700047236654,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.4620365639995361,0.4428142056392469,0.4648045911203806,0.0,0.04911932522947159,0.04996578478889472,0.0,0.2927051671732523,0.2760101854801178,1.5821116748810904,0.6229102972744422,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0
1,2021.0,1,0.4762845849802372,0.5282685512367491,0.9200176108012914,0.48757763975155277,0.49616858237547895,0.38979118329466356,0.45855811672388425,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.3980978816455363,0.4641592336214714,0.4451259300414946,0.4776386065456221,0.0,0.051702709420830224,0.04833442666835588,0.0,0.3293541475359657,0.2792655229568481,0.7051182620476528,0.6309994170606904,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0
1,2022.0,1,0.4899665551839465,0.5767511177347243,0.9302186283318359,0.496875,0.4896694214876033,0.42142327650111194,0.4874822862541332,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.4530541291186285,0.5097880138188646,0.0,0.048570019723865876,0.04938041570024613,0.0,0.3133556434438698,0.2648949027061462,0.0,0.6097498396407954,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0
1,2020.0,1,0.4456066945606695,0.5435606060606061,0.9005011792452831,0.4628975265017668,0.4928571428571429,0.3304608467590858,0.42528195488721804,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.4620365639995361,0.4428142056392469,0.4648045911203806,0.0,0.049143708116157855,0.04996578478889472,0.0,0.2924012158054711,0.2760101854801178,1.5821116748810904,0.6224217580844558,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0
1,2021.0,1,0.4796747967479675,0.5254545454545455,0.9192601291837933,0.48623853211009177,0.5,0.38683602771362585,0.4620655898188938,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.3980978816455363,0.4641592336214714,0.4451259300414946,0.4776386065456221,0.0,0.0511166253101737,0.04833442666835588,0.0,0.3289594140982606,0.2792655229568481,0.7169224098724992,0.6320015541021822,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0
1,2022.0,1,0.48877374784110533,0.5664556962025317,0.9273952095808383,0.4984709480122324,0.4919678714859438,0.42327650111193477,0.4901593252108716,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.4530541291186285,0.5097880138188646,0.0,0.04852216748768473,0.04938041570024613,0.0,0.31217734588521107,0.2648949027061462,0.0,0.6123051260665939,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0
2,2019.0,1,0.5623931623931624,0.5625990491283677,0.8589656345695815,0.3341584158415842,0.4426229508196721,0.44052863436123346,0.5452823039029936,0.5403293808853606,0.5311791259117856,0.8735970003111929,0.3943366638089926,0.465356415881109,0.4438849669010334,0.4705375056413739,0.0,0.05025868440502587,0.05113363440615968,0.0,0.28154170430593195,0.3023858368396759,0.0,0.5392124746118063,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0
2,2020.0,1,0.4968421052631579,0.516728624535316,0.8991959499702203,0.46539792387543255,0.49336283185840707,0.32237579379902875,0.42258823529411765,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.4620365639995361,0.4428142056392469,0.4648045911203806,0.0,0.05358471843215083,0.04996578478889472,0.0,0.29526123936816523,0.2760101854801178,1.612974117630252,0.6220344491387715,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0
2,2021.0,1,0.5222672064777328,0.5359712230215827,0.9146732788798133,0.4875,0.5,0.37208413001912044,0.4604105571847507,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.3980978816455363,0.4641592336214714,0.4451259300414946,0.4776386065456221,0.0,0.06154603643525357,0.04833442666835588,0.0,0.31693989071038253,0.2792655229568481,0.7416645880174457,0.6318096834504545,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0
2,2022.0,1,0.506872852233677,0.5628834355828221,0.9257515942909201,0.4952978056426332,0.4961089494163424,0.4094922737306843,0.487453531598513,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.4530541291186285,0.5097880138188646,0.0,0.04864197530864198,0.04938041570024613,0.0,0.319647201946472,0.2648949027061462,0.0,0.6081150487930149,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0
2,2020.0,1,0.4904051172707889,0.5196998123827392,0.898868036937742,0.46539792387543255,0.49333333333333335,0.32415333085225156,0.42240975152367555,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.4620365639995361,0.4428142056392469,0.4648045911203806,0.0,0.05357142857142857,0.04996578478889472,0.0,0.29526123936816523,0.2760101854801178,1.612974117630252,0.6215548621944877,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0
2,2021.0,1,0.5145833333333333,0.5353901996370236,0.9143775569842197,0.4888888888888889,0.4980694980694981,0.37547600913937546,0.4616511968734734,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.3980978816455363,0.4641592336214714,0.4451259300414946,0.4776386065456221,0.0,0.06047889410022217,0.04833442666835588,0.0,0.31671732522796353,0.2792655229568481,0.7340164516985729,0.6316673124112101,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0
2,2022.0,1,0.5009009009009009,0.5664556962025317,0.9255222524977293,0.4952978056426332,0.49607843137254903,0.4153225806451613,0.48303114830311483,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.4530541291186285,0.5097880138188646,0.0,0.04878652798415057,0.04938041570024613,0.0,0.3192202254035943,0.2648949027061462,0.0,0.61000385752861,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
run,time,id_DemographicStatistics,demMarried18to29Share,demMarried30to54Share,demMarried55to74Share,demNChild18to29Avg,demNChild30to54Avg,demNChild55to74Avg,demPop18to29N,demPop30to54N,demPop55to74N
1,2019.0,1,0.2620357634112792,0.6720496894409937,0.5969519343493552,0.29332874828060523,0.9503105590062112,0.07409144196951935,2908.0,6440.0,4265.0
1,2020.0,1,0.43235704323570434,0.7603370260571072,0.6448706099815157,0.32391910739191077,0.9753471680449368,0.08133086876155268,2868.0,6409.0,4328.0
1,2021.0,1,0.4281172730483928,0.7752529182879377,0.6561363636363636,0.3288590604026846,0.9708949416342413,0.08613636363636364,2831.0,6425.0,4400.0
1,2022.0,1,0.37104708362614197,0.7549883990719257,0.6552583862194016,0.3236120871398454,0.9540603248259861,0.08794197642792384,2846.0,6465.0,4412.0
1,2020.0,1,0.4320083682008368,0.7601499063085572,0.6444393170281495,0.32391910739191077,0.9761086820737039,0.08121827411167512,2868.0,6404.0,4334.0
1,2021.0,1,0.43254667136315605,0.7767398411957029,0.6551331664010926,0.33110250088059173,0.973688307644403,0.08559071249715457,2839.0,6423.0,4393.0
1,2022.0,1,0.3804347826086957,0.7568864128752708,0.6534181240063593,0.31661991584852733,0.9571340142370783,0.08766749943220531,2852.0,6462.0,4403.0
2,2019.0,1,0.26082474226804125,0.6719428926132837,0.5978439184438715,0.2934707903780069,0.9497206703910615,0.07429107101007734,2910.0,6444.0,4267.0
2,2020.0,1,0.4287704632532219,0.7569714908864309,0.6478190630048465,0.3333333333333333,0.9691540738432778,0.08331410108469882,2871.0,6419.0,4333.0
2,2021.0,1,0.43522408963585435,0.7727272727272727,0.6577272727272727,0.34978991596638653,0.9652133580705009,0.09045454545454545,2856.0,6468.0,4400.0
2,2022.0,1,0.3675333801827126,0.7488386497367606,0.6598546775658493,0.3323963457484188,0.9377516258903685,0.09150772025431426,2846.0,6458.0,4404.0
2,2020.0,1,0.427725531173807,0.7568157033805889,0.646963749711383,0.332985022640195,0.9691540738432778,0.08335257446317247,2871.0,6419.0,4331.0
2,2021.0,1,0.4349807220469681,0.7736931906313014,0.6553056123608271,0.3480546792849632,0.9640142702031953,0.0897523290161327,2853.0,6447.0,4401.0
2,2022.0,1,0.3694581280788177,0.7533032799626924,0.6564486830154405,0.3346235045742435,0.9417068241877817,0.09082652134423251,2842.0,6433.0,4404.0
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
run,time,id_HealthStatistics,healthDsbl18to29Share,healthDsbl30to54Share,healthDsbl55to74Share,healthScore18to29Avg,healthScore30to54Avg,healthScore55to74Avg
1,2019.0,1,0.05811554332874828,0.09130434782608696,0.06236811254396248,3.69050894085282,3.4482919254658384,3.092379835873388
1,2020.0,1,0.05788005578800558,0.0962708690903417,0.07024029574861368,3.584030683403068,3.3867998127633014,3.0499075785582255
1,2021.0,1,0.06464146944542565,0.09867704280155642,0.06431818181818182,3.4906393500529846,3.3063035019455254,2.9979545454545455
1,2022.0,1,0.06640899508081517,0.1048723897911833,0.06799637352674524,3.409697821503865,3.279969064191802,2.9290571169537625
1,2020.0,1,0.05788005578800558,0.09618988132417239,0.06991232118135672,3.584379358437936,3.38632104934416,3.050299953853253
1,2021.0,1,0.06305036984853822,0.09917484041725051,0.06442066924652856,3.4945403311025007,3.3051533551300016,2.9927156840427953
1,2022.0,1,0.06486676016830295,0.1053853296193129,0.0685895980013627,3.414095371669004,3.28149179820489,2.9280036338859867
2,2019.0,1,0.05807560137457045,0.09109248913718188,0.0625732364659011,3.689347079037801,3.450651769087523,3.089289899226623
2,2020.0,1,0.05886450714036921,0.09736719115126967,0.07085160396953612,3.582723789620341,3.3782520641844522,3.039464574198015
2,2021.0,1,0.06197478991596639,0.10482374768089053,0.06681818181818182,3.502450980392157,3.3140074211502784,2.9813636363636364
2,2022.0,1,0.06430077301475755,0.10405698358624961,0.06970935513169846,3.4205903021784962,3.2890987921957264,2.9302906448683017
2,2020.0,1,0.05886450714036921,0.09689982863374358,0.07134610944354652,3.582375478927203,3.3785636391961367,3.0374047564072963
2,2021.0,1,0.06239046617595514,0.10469986040018614,0.06771188366280391,3.5033298282509637,3.3108422522103305,2.9820495341967734
2,2022.0,1,0.06685432793807178,0.1027514378983367,0.06766575840145322,3.418015482054891,3.2928649152805844,2.9314259763851043
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
run,time,id_LabourStatistics,labEmpShare,labEmpToNotEmpShare,labNotEmpToEmpShare,labUnempShare,labWorkFullTime18to29Share,labWorkFullTime30to54Share,labWorkFullTime55to74Share,labWorkPartTime18to29Share,labWorkPartTime30to54Share,labWorkPartTime55to74Share
1,2019.0,1,0.712445288628293,0.0,0.0,0.15533900404657694,0.561554332874828,0.6751552795031056,0.2797186400937866,0.09353507565337002,0.140527950310559,0.08253223915592028
1,2020.0,1,0.7179465983301645,0.07705459933888066,0.40707497360084477,0.1521864925188063,0.49860529986053,0.7409892338898424,0.3213955637707948,0.14783821478382148,0.09549071618037135,0.06076709796672828
1,2021.0,1,0.7499176548089591,0.01987647389107243,0.3590568060021436,0.10828392621870883,0.5231367008124338,0.7875486381322957,0.35659090909090907,0.13952666902154715,0.0840466926070039,0.06159090909090909
1,2022.0,1,0.7638605372744346,0.024143799191661347,0.29681717246484085,0.09969788519637462,0.5144061841180604,0.7993812838360402,0.38077969174977333,0.15706254392129304,0.08785769528228925,0.06414324569356301
1,2020.0,1,0.7175225336971802,0.07746719908727895,0.40664556962025317,0.15248490862482428,0.49860529986053,0.7409431605246721,0.3204891555145362,0.148186889818689,0.09509681449094316,0.06045223811721274
1,2021.0,1,0.7493414553836022,0.019795298616578562,0.3625668449197861,0.10833058939743168,0.5223670306445932,0.7884166277440449,0.3530616890507626,0.13983797111659035,0.08438424412268411,0.06191668563623947
1,2022.0,1,0.7627409343351845,0.023156546793298476,0.293470286133529,0.1002123489055864,0.5150771388499299,0.7977406375735067,0.37815126050420167,0.15427769985974754,0.08882698854843701,0.06495571201453554
2,2019.0,1,0.7128238983330583,0.0,0.0,0.15514111239478462,0.5618556701030928,0.675667287399131,0.28005624560581205,0.09347079037800687,0.1404407200496586,0.0824935551910007
2,2020.0,1,0.7114559260482007,0.08077709611451943,0.38862307283359915,0.15673489600528226,0.49773598049460116,0.7378096276678611,0.32333256404338795,0.14071752002786486,0.09066832840006231,0.05746595891991692
2,2021.0,1,0.7444735549369575,0.021012200632625395,0.3481822836661546,0.1171606353364991,0.5301120448179272,0.7824675324675324,0.3575,0.13025210084033614,0.08039579468150897,0.06
2,2022.0,1,0.7544748671843073,0.026426039316790204,0.2877648667122351,0.10608908868001635,0.5017568517217147,0.7867760916692474,0.3807901907356948,0.15706254392129304,0.0901207804273769,0.06153496821071753
2,2020.0,1,0.7114321089558399,0.08077709611451943,0.3876464323748669,0.15674783326454808,0.49738766980146293,0.7387443527029133,0.32302008773955204,0.14071752002786486,0.0900451783766942,0.05749249595936273
2,2021.0,1,0.7445638795437761,0.020495980070207226,0.3470015376729882,0.11717403790924756,0.5331230283911672,0.7839305103148752,0.3565098841172461,0.12828601472134596,0.07910656119125174,0.06089525107930016
2,2022.0,1,0.7559796854521625,0.02496771416272062,0.28796169630642954,0.10493119266055045,0.5087966220971147,0.7909218094201772,0.38033605812897364,0.15235749472202675,0.08767293642157625,0.06335149863760219
Loading
Loading