Skip to content

Commit

Permalink
fix western closure policy
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaspayette committed Nov 15, 2023
1 parent 9f8166e commit 5d44a37
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions epo/src/main/java/uk/ac/ox/poseidon/epo/WesternClosure.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import uk.ac.ox.oxfish.experiments.tuna.Policy;
import uk.ac.ox.oxfish.model.scenario.EpoScenario;
import uk.ac.ox.oxfish.regulations.ForbiddenIf;
import uk.ac.ox.oxfish.regulations.NamedRegulations;
import uk.ac.ox.oxfish.regulations.conditions.AnyOf;
import uk.ac.ox.oxfish.regulations.conditions.BetweenYearlyDates;
import uk.ac.ox.oxfish.regulations.conditions.InRectangularArea;
Expand Down Expand Up @@ -36,20 +38,27 @@ public List<Policy<EpoScenario<?>>> get() {
extraDays,
extraDays
),
epoScenario ->
new AnyOf(
yearsActiveCondition(),
new BetweenYearlyDates(
addDays(EL_CORRALITO_BEGINNING, -extraDays),
addDays(EL_CORRALITO_END, extraDays)
),
new InRectangularArea(
50,
-150,
-50,
eastLongitude
epoScenario -> {
final NamedRegulations namedRegulations = (NamedRegulations) epoScenario.getRegulations();
namedRegulations.modify(
"El Corralito",
() -> new ForbiddenIf(
new AnyOf(
yearsActiveCondition(),
new BetweenYearlyDates(
addDays(EL_CORRALITO_BEGINNING, -extraDays),
addDays(EL_CORRALITO_END, extraDays)
),
new InRectangularArea(
50,
-150,
-50,
eastLongitude
)
)
)
)
);
}
)
).collect(toImmutableList());
}
Expand Down

0 comments on commit 5d44a37

Please sign in to comment.