Skip to content

Commit

Permalink
remove event overloads on Plan
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-super committed Nov 4, 2024
1 parent e6515a7 commit 05da212
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import gov.nasa.ammos.aerie.procedural.scheduling.Goal;
import gov.nasa.ammos.aerie.procedural.scheduling.plan.EditablePlan;
import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.DirectiveStart;
import gov.nasa.ammos.aerie.procedural.timeline.plan.EventQuery;
import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue;
import org.jetbrains.annotations.NotNull;

Expand All @@ -13,7 +14,9 @@
public record ExternalEventsSimpleGoal() implements Goal {
@Override
public void run(@NotNull final EditablePlan plan) {
for (final var e: plan.events("TestGroup")) {
EventQuery eventQuery = new EventQuery("TestGroup", null, null);

for (final var e: plan.events(eventQuery)) {
plan.create("BiteBanana", new DirectiveStart.Absolute(e.getInterval().start), Map.of("biteSize", SerializedValue.of(1)));
}
plan.commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ interface Plan {

/** Get external events associated with this plan. */
fun events(query: EventQuery): ExternalEvents
/** Get external events belonging to a given derivation group and external event type associated with this plan. */
fun events(derivationGroup: String, eventType: String) = events(EventQuery(derivationGroup, eventType, null))
/** Get external events belonging to a given derivation group associated with this plan. */
fun events(derivationGroup: String) = events(EventQuery(derivationGroup, null, null))
/** Get all external events across all derivation groups associated with this plan. */
fun events() = events(EventQuery())
}

0 comments on commit 05da212

Please sign in to comment.