From 0577c0a0923691d513e3fed7b0805dc27e871817 Mon Sep 17 00:00:00 2001 From: Alexander M Greer Date: Mon, 22 Jan 2024 14:06:22 -0800 Subject: [PATCH] adding the russian banana activity --- .../activities/RussianBanana.java | 43 +++++++++++++++++++ .../jpl/aerie/banananation/package-info.java | 3 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 examples/banananation/src/main/java/gov/nasa/jpl/aerie/banananation/activities/RussianBanana.java diff --git a/examples/banananation/src/main/java/gov/nasa/jpl/aerie/banananation/activities/RussianBanana.java b/examples/banananation/src/main/java/gov/nasa/jpl/aerie/banananation/activities/RussianBanana.java new file mode 100644 index 0000000000..0331d2f998 --- /dev/null +++ b/examples/banananation/src/main/java/gov/nasa/jpl/aerie/banananation/activities/RussianBanana.java @@ -0,0 +1,43 @@ +package gov.nasa.jpl.aerie.banananation.activities; + +import gov.nasa.jpl.aerie.banananation.Mission; +import gov.nasa.jpl.aerie.merlin.framework.annotations.ActivityType; +import gov.nasa.jpl.aerie.merlin.framework.annotations.Export; +import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; + +import java.util.List; + +import static gov.nasa.jpl.aerie.banananation.generated.ActivityActions.call; +import static gov.nasa.jpl.aerie.merlin.framework.ModelActions.delay; + +/** + * Russian Banana Encloses Banana + * + * This activity causes a piece of banana to be bitten off and consumed. + * + * @subsystem fruit + * @contact John Doe + */ +@ActivityType("RussianBanana") +public final class RussianBanana { + + @Export.Parameter + public List testints; + + @Export.Parameter + public List biteBananaActivity; + + @Export.Parameter + public PeelBananaActivity peelBananaActivity; + + + @ActivityType.EffectModel + public void run(final Mission mission) { + for (final var bite : biteBananaActivity) { + call(mission, bite); + delay(Duration.of(30, Duration.MINUTE)); + } + call(mission, peelBananaActivity); + } + +} diff --git a/examples/banananation/src/main/java/gov/nasa/jpl/aerie/banananation/package-info.java b/examples/banananation/src/main/java/gov/nasa/jpl/aerie/banananation/package-info.java index 1f27ab1fb0..d14ea407de 100644 --- a/examples/banananation/src/main/java/gov/nasa/jpl/aerie/banananation/package-info.java +++ b/examples/banananation/src/main/java/gov/nasa/jpl/aerie/banananation/package-info.java @@ -26,7 +26,7 @@ @WithActivityType(ControllableDurationActivity.class) @WithActivityType(RipenBananaActivity.class) @WithActivityType(ExceptionActivity.class) - +@WithActivityType(RussianBanana.class) package gov.nasa.jpl.aerie.banananation; import gov.nasa.jpl.aerie.banananation.activities.BakeBananaBreadActivity; @@ -46,6 +46,7 @@ import gov.nasa.jpl.aerie.banananation.activities.PeelBananaActivity; import gov.nasa.jpl.aerie.banananation.activities.PickBananaActivity; import gov.nasa.jpl.aerie.banananation.activities.RipenBananaActivity; +import gov.nasa.jpl.aerie.banananation.activities.RussianBanana; import gov.nasa.jpl.aerie.banananation.activities.ThrowBananaActivity; import gov.nasa.jpl.aerie.contrib.serialization.rulesets.BasicValueMappers; import gov.nasa.jpl.aerie.merlin.framework.annotations.MissionModel;