Skip to content

Commit 5d44a37

Browse files
fix western closure policy
1 parent 9f8166e commit 5d44a37

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

epo/src/main/java/uk/ac/ox/poseidon/epo/WesternClosure.java

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import uk.ac.ox.oxfish.experiments.tuna.Policy;
44
import uk.ac.ox.oxfish.model.scenario.EpoScenario;
5+
import uk.ac.ox.oxfish.regulations.ForbiddenIf;
6+
import uk.ac.ox.oxfish.regulations.NamedRegulations;
57
import uk.ac.ox.oxfish.regulations.conditions.AnyOf;
68
import uk.ac.ox.oxfish.regulations.conditions.BetweenYearlyDates;
79
import uk.ac.ox.oxfish.regulations.conditions.InRectangularArea;
@@ -36,20 +38,27 @@ public List<Policy<EpoScenario<?>>> get() {
3638
extraDays,
3739
extraDays
3840
),
39-
epoScenario ->
40-
new AnyOf(
41-
yearsActiveCondition(),
42-
new BetweenYearlyDates(
43-
addDays(EL_CORRALITO_BEGINNING, -extraDays),
44-
addDays(EL_CORRALITO_END, extraDays)
45-
),
46-
new InRectangularArea(
47-
50,
48-
-150,
49-
-50,
50-
eastLongitude
41+
epoScenario -> {
42+
final NamedRegulations namedRegulations = (NamedRegulations) epoScenario.getRegulations();
43+
namedRegulations.modify(
44+
"El Corralito",
45+
() -> new ForbiddenIf(
46+
new AnyOf(
47+
yearsActiveCondition(),
48+
new BetweenYearlyDates(
49+
addDays(EL_CORRALITO_BEGINNING, -extraDays),
50+
addDays(EL_CORRALITO_END, extraDays)
51+
),
52+
new InRectangularArea(
53+
50,
54+
-150,
55+
-50,
56+
eastLongitude
57+
)
58+
)
5159
)
52-
)
60+
);
61+
}
5362
)
5463
).collect(toImmutableList());
5564
}

0 commit comments

Comments
 (0)