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
18 changes: 18 additions & 0 deletions src/main/java/simpaths/model/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class Person implements EventListener, IDoubleSource, IIntSource, Weight,
private Long idOriginalHH;
private Long idMother;
private Long idFather;
private Long idPartner;
private Boolean clonedFlag;
private Boolean bornInSimulation; //Flag to keep track of newborns
private Long seed;
Expand All @@ -59,6 +60,7 @@ public class Person implements EventListener, IDoubleSource, IIntSource, Weight,

// person level variables
private int dag; //Age
private Dcpst dcpst;
@Enumerated(EnumType.STRING) private Indicator adultchildflag;
@Transient private boolean ioFlag; // true if a dummy person instantiated for IO decision solution
@Enumerated(EnumType.STRING) private Gender dgn; // gender
Expand Down Expand Up @@ -712,6 +714,7 @@ public enum Processes {
SocialCareProvision,
Unemployment,
Update,
UpdateOutputVariables,
UpdatePotentialHourlyEarnings, //Needed to union matching and labour supply
}

Expand All @@ -724,6 +727,9 @@ public void onEvent(Enum<?> type) {
case Update -> {
updateVariables(false);
}
case UpdateOutputVariables -> {
updateOutputVariables();
}
case ProjectEquivConsumption -> {
projectEquivConsumption();
}
Expand Down Expand Up @@ -1896,6 +1902,11 @@ protected void updateVariables(boolean initialUpdate) {
}
}

private void updateOutputVariables() {
idPartner = getPartnerID();
dcpst = getDcpst();
}

private void updateLaggedVariables(boolean initialUpdate) {

les_c4_lag1 = les_c4;
Expand Down Expand Up @@ -4332,6 +4343,13 @@ public Person getPartner() {
return null;
}

public Long getPartnerID() {
Person partner = this.getPartner();
if (partner != null) {
return partner.getId();
} else return null;
}

private void nullPartnerVariables() {

careHoursFromPartnerWeekly = 0.0;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/simpaths/model/SimPathsModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ public void buildSchedule() {
addCollectionEventToAllYears(persons, Person.Processes.HealthEQ5D);
addEventToAllYears(Processes.CheckForImperfectTaxDBMatches);
addEventToAllYears(tests, Tests.Processes.RunTests); //Run tests
addCollectionEventToAllYears(persons, Person.Processes.UpdateOutputVariables); // Update idPartner, dhhtp_c4
addEventToAllYears(Processes.EndYear);

// UPDATE YEAR
Expand Down