Skip to content

Commit

Permalink
not sure if these comments help
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Szendrey committed Oct 16, 2024
1 parent 839b37e commit f4e0c3d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ public InterventionPolicy clone() {
// If any of them are are invalid the entire policy is invalid.
public Boolean validateInterventionPolicy() throws Exception {
for (int i = 0; i < this.interventions.size(); i++) {
this.interventions.get(i).validateIntervention();
this.interventions.get(i).validateIntervention(); //validate individual intervention
for (int j = 0; j < this.interventions.size(); j++) {
if (Integer.compare(i, j) != 0) {
validateInterventionPair(this.interventions.get(i), this.interventions.get(j));
validateInterventionPair(this.interventions.get(i), this.interventions.get(j)); //validate pair with eachother
}
}
}
return true;
}

// Takes a list of two interventions and will check their static intervention lists to ensure
// there are no duplicate time + appliedTo pairs in static interventions
// there are no duplicate time + appliedTo pairs in their indiviudal static interventions
private Boolean validateInterventionPair(Intervention interOne, Intervention interTwo) throws Exception {
List<StaticIntervention> staticOne = interOne.getStaticInterventions();
List<StaticIntervention> staticTwo = interTwo.getStaticInterventions();
Expand Down

0 comments on commit f4e0c3d

Please sign in to comment.