From f32a88973c70ab29a57dd6c6c03117864a50b440 Mon Sep 17 00:00:00 2001 From: JoelCourtney Date: Wed, 4 Sep 2024 12:44:00 -0700 Subject: [PATCH] Rebase after stateless aerie --- .../nasa/jpl/aerie/constraints/model/ActivityInstance.java | 2 +- e2e-tests/build.gradle | 1 + .../java/gov/nasa/jpl/aerie/merlin/driver/ActivityId.java | 4 ---- .../nasa/jpl/aerie/merlin/driver/SimulationResults.java | 3 ++- .../nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java | 1 + .../jpl/aerie/merlin/driver/engine/SimulationEngine.java | 4 ++-- .../nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java | 2 ++ .../aerie/merlin/driver/TemporalSubsetSimulationTests.java | 2 ++ .../jpl/aerie/merlin/server/http/ResponseSerializers.java | 2 +- .../merlin/server/models/SimulationResultsHandle.java | 4 ++-- .../server/remotes/InMemoryResultsCellRepository.java | 4 ++-- .../remotes/postgres/PostgresResultsCellRepository.java | 4 ++-- .../orchestration/simulation/SimulationResultsWriter.java | 4 ++-- procedural/constraints/build.gradle | 1 + .../nasa/ammos/aerie/procedural/constraints/Violation.kt | 2 +- .../nasa/ammos/aerie/procedural/constraints/Violations.kt | 2 +- procedural/examples/foo-procedures/build.gradle | 2 +- procedural/remote/build.gradle | 1 + .../ammos/aerie/procedural/remote/AeriePostgresPlan.kt | 2 +- .../procedural/remote/AeriePostgresSimulationResults.kt | 5 ++--- procedural/scheduling/build.gradle | 1 + .../ammos/aerie/procedural/scheduling/plan/EditablePlan.kt | 2 +- .../ammos/aerie/procedural/scheduling/plan/NewDirective.kt | 2 +- procedural/timeline/build.gradle | 1 + .../procedural/timeline/payloads/activities/Directive.kt | 2 +- .../timeline/payloads/activities/DirectiveStart.kt | 2 +- .../procedural/timeline/payloads/activities/Instance.kt | 7 +++---- .../aerie/scheduler/simulation/SimulationFacadeUtils.java | 4 ++-- .../scheduler/simulation/SimulationResultsConverter.java | 2 +- .../nasa/jpl/aerie/scheduler/plan/InMemoryEditablePlan.kt | 6 +----- .../plan/MerlinToProcedureSimulationResultsAdapter.kt | 6 +++--- .../aerie/scheduler/simulation/AnchorSchedulerTest.java | 4 ++-- .../simulation/SimulationResultsComparisonUtils.java | 2 +- .../server/services/GraphQLMerlinDatabaseService.java | 4 ++-- .../worker/services/SynchronousSchedulerAgent.java | 1 - .../src/main/java/gov/nasa/jpl/aerie/types/ActivityId.java | 4 ++++ .../java/gov/nasa/jpl/aerie/types}/ActivityInstance.java | 3 +-- .../java/gov/nasa/jpl/aerie/types}/ActivityInstanceId.java | 2 +- 38 files changed, 55 insertions(+), 52 deletions(-) delete mode 100644 merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityId.java create mode 100644 type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityId.java rename {merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver => type-utils/src/main/java/gov/nasa/jpl/aerie/types}/ActivityInstance.java (84%) rename {merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver => type-utils/src/main/java/gov/nasa/jpl/aerie/types}/ActivityInstanceId.java (61%) diff --git a/constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java b/constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java index 8a3c8758c3..4296b52fb8 100644 --- a/constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java +++ b/constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.constraints.model; import gov.nasa.jpl.aerie.constraints.time.Interval; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.types.ActivityDirectiveId; diff --git a/e2e-tests/build.gradle b/e2e-tests/build.gradle index 5c2ec884aa..4ff48fdab6 100644 --- a/e2e-tests/build.gradle +++ b/e2e-tests/build.gradle @@ -59,6 +59,7 @@ dependencies { testImplementation "com.zaxxer:HikariCP:5.1.0" testImplementation("org.postgresql:postgresql:42.6.0") testImplementation project(':merlin-driver') + testImplementation project(':type-utils') testImplementation 'com.microsoft.playwright:playwright:1.37.0' diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityId.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityId.java deleted file mode 100644 index fe5ee3d894..0000000000 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityId.java +++ /dev/null @@ -1,4 +0,0 @@ -package gov.nasa.jpl.aerie.merlin.driver; - -public interface ActivityId { -} diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationResults.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationResults.java index 8f3e5f481d..3cc0b6431d 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationResults.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationResults.java @@ -7,7 +7,8 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.RealDynamics; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; -import org.apache.commons.lang3.tuple.Pair; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import org.apache.commons.lang3.tuple.Triple; import java.time.Instant; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java index b6ef8f4a60..a8e4279162 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java @@ -2,6 +2,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import java.time.Instant; import java.util.List; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java index f1000b8bdd..916df89c95 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java @@ -1,8 +1,8 @@ package gov.nasa.jpl.aerie.merlin.driver.engine; import gov.nasa.jpl.aerie.merlin.driver.MissionModel.SerializableTopic; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.resources.SimulationResourceManager; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.UnfinishedActivity; diff --git a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java index 2e87d5e944..9a73431d2e 100644 --- a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java +++ b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java @@ -4,6 +4,8 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.types.ActivityDirective; import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.types.SerializedActivity; import org.apache.commons.lang3.tuple.Pair; import org.junit.jupiter.api.DisplayName; diff --git a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/TemporalSubsetSimulationTests.java b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/TemporalSubsetSimulationTests.java index cd67abdd32..a2c2eabb58 100644 --- a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/TemporalSubsetSimulationTests.java +++ b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/TemporalSubsetSimulationTests.java @@ -4,6 +4,8 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.types.ActivityDirective; import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.types.SerializedActivity; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java index a32f70e568..a47e503e6c 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java @@ -5,7 +5,7 @@ import gov.nasa.jpl.aerie.constraints.model.ConstraintResult; import gov.nasa.jpl.aerie.constraints.time.Interval; import gov.nasa.jpl.aerie.json.JsonParseResult.FailureReason; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.UnfinishedActivity; import gov.nasa.jpl.aerie.merlin.driver.json.ValueSchemaJsonParser; import gov.nasa.jpl.aerie.merlin.protocol.model.InputType.Parameter; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/SimulationResultsHandle.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/SimulationResultsHandle.java index 8a94cec3dd..a097ae7ab3 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/SimulationResultsHandle.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/SimulationResultsHandle.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.models; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/InMemoryResultsCellRepository.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/InMemoryResultsCellRepository.java index 5e60a356ef..0524fa9d58 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/InMemoryResultsCellRepository.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/InMemoryResultsCellRepository.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.remotes; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationFailure; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.resources.ResourceProfile; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresResultsCellRepository.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresResultsCellRepository.java index 39b7cd2f5e..51de431da5 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresResultsCellRepository.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresResultsCellRepository.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationException; import gov.nasa.jpl.aerie.merlin.driver.SimulationFailure; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; diff --git a/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationResultsWriter.java b/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationResultsWriter.java index 9b4fab105b..043d965e36 100644 --- a/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationResultsWriter.java +++ b/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationResultsWriter.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.orchestration.simulation; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.UnfinishedActivity; import gov.nasa.jpl.aerie.merlin.driver.engine.EventRecord; diff --git a/procedural/constraints/build.gradle b/procedural/constraints/build.gradle index 87e8f93561..5d149d08b2 100644 --- a/procedural/constraints/build.gradle +++ b/procedural/constraints/build.gradle @@ -15,6 +15,7 @@ repositories { dependencies { implementation project(':procedural:timeline') implementation project(':merlin-driver') + implementation project(':type-utils') testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' diff --git a/procedural/constraints/src/main/kotlin/gov/nasa/ammos/aerie/procedural/constraints/Violation.kt b/procedural/constraints/src/main/kotlin/gov/nasa/ammos/aerie/procedural/constraints/Violation.kt index b3fb5c7cfc..3fcbc3e9cd 100644 --- a/procedural/constraints/src/main/kotlin/gov/nasa/ammos/aerie/procedural/constraints/Violation.kt +++ b/procedural/constraints/src/main/kotlin/gov/nasa/ammos/aerie/procedural/constraints/Violation.kt @@ -2,7 +2,7 @@ package gov.nasa.ammos.aerie.procedural.constraints import gov.nasa.ammos.aerie.procedural.timeline.Interval import gov.nasa.ammos.aerie.procedural.timeline.payloads.IntervalLike -import gov.nasa.jpl.aerie.merlin.driver.ActivityId +import gov.nasa.jpl.aerie.types.ActivityId /** A single violation of a constraint. */ data class Violation( diff --git a/procedural/constraints/src/main/kotlin/gov/nasa/ammos/aerie/procedural/constraints/Violations.kt b/procedural/constraints/src/main/kotlin/gov/nasa/ammos/aerie/procedural/constraints/Violations.kt index 831c2b4a1e..3a5c894cd6 100644 --- a/procedural/constraints/src/main/kotlin/gov/nasa/ammos/aerie/procedural/constraints/Violations.kt +++ b/procedural/constraints/src/main/kotlin/gov/nasa/ammos/aerie/procedural/constraints/Violations.kt @@ -12,7 +12,7 @@ import gov.nasa.ammos.aerie.procedural.timeline.payloads.IntervalLike import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.Directive import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.Instance import gov.nasa.ammos.aerie.procedural.timeline.util.preprocessList -import gov.nasa.jpl.aerie.merlin.driver.ActivityId +import gov.nasa.jpl.aerie.types.ActivityId /** A timeline of [Violations][Violation]. */ data class Violations(private val timeline: Timeline): diff --git a/procedural/examples/foo-procedures/build.gradle b/procedural/examples/foo-procedures/build.gradle index eedf525530..3ba155b189 100644 --- a/procedural/examples/foo-procedures/build.gradle +++ b/procedural/examples/foo-procedures/build.gradle @@ -20,8 +20,8 @@ dependencies { implementation project(':procedural:constraints') implementation project(':procedural:scheduling') implementation project(':procedural:timeline') - implementation project(':merlin-framework') implementation project(':merlin-driver') + implementation project(':type-utils') implementation project(':contrib') testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' diff --git a/procedural/remote/build.gradle b/procedural/remote/build.gradle index d54145aea9..82b13ab83f 100644 --- a/procedural/remote/build.gradle +++ b/procedural/remote/build.gradle @@ -18,6 +18,7 @@ dependencies { implementation project(':merlin-driver') implementation project(':scheduler-driver') implementation project(':parsing-utilities') + implementation project(':type-utils') testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' diff --git a/procedural/remote/src/main/kotlin/gov/nasa/ammos/aerie/procedural/remote/AeriePostgresPlan.kt b/procedural/remote/src/main/kotlin/gov/nasa/ammos/aerie/procedural/remote/AeriePostgresPlan.kt index f520f28052..05f7701f0e 100644 --- a/procedural/remote/src/main/kotlin/gov/nasa/ammos/aerie/procedural/remote/AeriePostgresPlan.kt +++ b/procedural/remote/src/main/kotlin/gov/nasa/ammos/aerie/procedural/remote/AeriePostgresPlan.kt @@ -12,7 +12,7 @@ import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.DirectiveSta import gov.nasa.ammos.aerie.procedural.timeline.plan.Plan import gov.nasa.ammos.aerie.procedural.timeline.util.duration.plus import gov.nasa.ammos.aerie.procedural.timeline.util.duration.minus -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId +import gov.nasa.jpl.aerie.types.ActivityDirectiveId import java.io.StringReader import java.sql.Connection import java.time.Instant diff --git a/procedural/remote/src/main/kotlin/gov/nasa/ammos/aerie/procedural/remote/AeriePostgresSimulationResults.kt b/procedural/remote/src/main/kotlin/gov/nasa/ammos/aerie/procedural/remote/AeriePostgresSimulationResults.kt index cb65cac928..a7b1f94de9 100644 --- a/procedural/remote/src/main/kotlin/gov/nasa/ammos/aerie/procedural/remote/AeriePostgresSimulationResults.kt +++ b/procedural/remote/src/main/kotlin/gov/nasa/ammos/aerie/procedural/remote/AeriePostgresSimulationResults.kt @@ -12,8 +12,7 @@ import gov.nasa.ammos.aerie.procedural.timeline.payloads.Segment import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.Instance import gov.nasa.ammos.aerie.procedural.timeline.plan.Plan import gov.nasa.ammos.aerie.procedural.timeline.plan.SimulationResults -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId +import gov.nasa.jpl.aerie.types.ActivityDirectiveId import java.io.StringReader import java.sql.Connection import javax.json.Json @@ -166,7 +165,7 @@ data class AeriePostgresSimulationResults( result.add(Instance( deserializer(attributes), response.getString(4), - ActivityInstanceId(id), + gov.nasa.jpl.aerie.types.ActivityInstanceId(id), directiveId?.let { ActivityDirectiveId(it) }, between(start, start.plus(Duration.parseISO8601(response.getString(2)))) )) diff --git a/procedural/scheduling/build.gradle b/procedural/scheduling/build.gradle index de5cef2745..4377e02fe8 100644 --- a/procedural/scheduling/build.gradle +++ b/procedural/scheduling/build.gradle @@ -16,6 +16,7 @@ repositories { dependencies { implementation project(':procedural:timeline') implementation project(':merlin-driver') + implementation project(':type-utils') testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' diff --git a/procedural/scheduling/src/main/kotlin/gov/nasa/ammos/aerie/procedural/scheduling/plan/EditablePlan.kt b/procedural/scheduling/src/main/kotlin/gov/nasa/ammos/aerie/procedural/scheduling/plan/EditablePlan.kt index 9d8837729a..5a6e87b638 100644 --- a/procedural/scheduling/src/main/kotlin/gov/nasa/ammos/aerie/procedural/scheduling/plan/EditablePlan.kt +++ b/procedural/scheduling/src/main/kotlin/gov/nasa/ammos/aerie/procedural/scheduling/plan/EditablePlan.kt @@ -6,7 +6,7 @@ import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.AnyDirective import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.DirectiveStart import gov.nasa.ammos.aerie.procedural.timeline.plan.Plan import gov.nasa.ammos.aerie.procedural.timeline.plan.SimulationResults -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId +import gov.nasa.jpl.aerie.types.ActivityDirectiveId /** A plan representation that can be edited and simulated. */ interface EditablePlan: Plan { diff --git a/procedural/scheduling/src/main/kotlin/gov/nasa/ammos/aerie/procedural/scheduling/plan/NewDirective.kt b/procedural/scheduling/src/main/kotlin/gov/nasa/ammos/aerie/procedural/scheduling/plan/NewDirective.kt index e81dbe4aae..35320eeb43 100644 --- a/procedural/scheduling/src/main/kotlin/gov/nasa/ammos/aerie/procedural/scheduling/plan/NewDirective.kt +++ b/procedural/scheduling/src/main/kotlin/gov/nasa/ammos/aerie/procedural/scheduling/plan/NewDirective.kt @@ -3,7 +3,7 @@ package gov.nasa.ammos.aerie.procedural.scheduling.plan import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.AnyDirective import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.Directive import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.DirectiveStart -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId +import gov.nasa.jpl.aerie.types.ActivityDirectiveId /** A new directive to be created, which doesn't have an id yet. */ data class NewDirective( diff --git a/procedural/timeline/build.gradle b/procedural/timeline/build.gradle index 934b797369..743f1479b8 100644 --- a/procedural/timeline/build.gradle +++ b/procedural/timeline/build.gradle @@ -15,6 +15,7 @@ repositories { dependencies { implementation project(':merlin-driver') + implementation project(':type-utils') testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' diff --git a/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/Directive.kt b/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/Directive.kt index 12fc360bab..f0a3a9d01d 100644 --- a/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/Directive.kt +++ b/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/Directive.kt @@ -2,7 +2,7 @@ package gov.nasa.ammos.aerie.procedural.timeline.payloads.activities import gov.nasa.jpl.aerie.merlin.protocol.types.Duration import gov.nasa.ammos.aerie.procedural.timeline.Interval -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId +import gov.nasa.jpl.aerie.types.ActivityDirectiveId /** A wrapper of any type of activity directive containing common data. */ data class Directive( diff --git a/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/DirectiveStart.kt b/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/DirectiveStart.kt index 973f0aff3b..c799ab36a4 100644 --- a/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/DirectiveStart.kt +++ b/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/DirectiveStart.kt @@ -1,7 +1,7 @@ package gov.nasa.ammos.aerie.procedural.timeline.payloads.activities -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId import gov.nasa.jpl.aerie.merlin.protocol.types.Duration +import gov.nasa.jpl.aerie.types.ActivityDirectiveId /** Start behavior for an activity directive. */ sealed interface DirectiveStart { diff --git a/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/Instance.kt b/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/Instance.kt index 09cee6a470..932e916693 100644 --- a/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/Instance.kt +++ b/procedural/timeline/src/main/kotlin/gov/nasa/ammos/aerie/procedural/timeline/payloads/activities/Instance.kt @@ -1,9 +1,8 @@ package gov.nasa.ammos.aerie.procedural.timeline.payloads.activities -import gov.nasa.jpl.aerie.merlin.protocol.types.Duration import gov.nasa.ammos.aerie.procedural.timeline.Interval -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId +import gov.nasa.jpl.aerie.merlin.protocol.types.Duration +import gov.nasa.jpl.aerie.types.ActivityDirectiveId /** A wrapper of any type of activity instance containing common data. */ data class Instance( @@ -12,7 +11,7 @@ data class Instance( override val type: String, /** The instance id. */ - @JvmField val id: ActivityInstanceId, + @JvmField val id: gov.nasa.jpl.aerie.types.ActivityInstanceId, /** * The maybe-null id of the directive associated with this instance. diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacadeUtils.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacadeUtils.java index 772172fae5..377dd09300 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacadeUtils.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacadeUtils.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.simulation; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResultsComputerInputs; import gov.nasa.jpl.aerie.merlin.driver.engine.SimulationEngine; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationResultsConverter.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationResultsConverter.java index b858e31a8b..1d027b7642 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationResultsConverter.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationResultsConverter.java @@ -4,7 +4,7 @@ import gov.nasa.jpl.aerie.constraints.model.DiscreteProfile; import gov.nasa.jpl.aerie.constraints.model.LinearProfile; import gov.nasa.jpl.aerie.constraints.time.Interval; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; diff --git a/scheduler-driver/src/main/kotlin/gov/nasa/jpl/aerie/scheduler/plan/InMemoryEditablePlan.kt b/scheduler-driver/src/main/kotlin/gov/nasa/jpl/aerie/scheduler/plan/InMemoryEditablePlan.kt index a90c9b9abd..26591b71c6 100644 --- a/scheduler-driver/src/main/kotlin/gov/nasa/jpl/aerie/scheduler/plan/InMemoryEditablePlan.kt +++ b/scheduler-driver/src/main/kotlin/gov/nasa/jpl/aerie/scheduler/plan/InMemoryEditablePlan.kt @@ -2,25 +2,21 @@ package gov.nasa.jpl.aerie.scheduler.plan import gov.nasa.jpl.aerie.merlin.driver.MissionModel import gov.nasa.jpl.aerie.merlin.protocol.types.Duration -import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue import gov.nasa.ammos.aerie.procedural.scheduling.plan.Edit import gov.nasa.ammos.aerie.procedural.scheduling.plan.EditablePlan import gov.nasa.ammos.aerie.procedural.scheduling.plan.NewDirective import gov.nasa.ammos.aerie.procedural.scheduling.simulation.SimulateOptions import gov.nasa.jpl.aerie.scheduler.simulation.SimulationFacade -import gov.nasa.ammos.aerie.procedural.timeline.collections.Directives import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.AnyDirective import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.Directive import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.DirectiveStart import gov.nasa.ammos.aerie.procedural.timeline.plan.Plan -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId import gov.nasa.jpl.aerie.merlin.protocol.types.DurationType import gov.nasa.jpl.aerie.scheduler.DirectiveIdGenerator import gov.nasa.jpl.aerie.scheduler.model.* -import gov.nasa.jpl.aerie.scheduler.plan.InMemoryEditablePlan.Companion.validateArguments +import gov.nasa.jpl.aerie.types.ActivityDirectiveId import java.time.Instant import kotlin.jvm.optionals.getOrNull -import kotlin.math.absoluteValue import gov.nasa.ammos.aerie.procedural.timeline.plan.SimulationResults as TimelineSimResults data class InMemoryEditablePlan( diff --git a/scheduler-driver/src/main/kotlin/gov/nasa/jpl/aerie/scheduler/plan/MerlinToProcedureSimulationResultsAdapter.kt b/scheduler-driver/src/main/kotlin/gov/nasa/jpl/aerie/scheduler/plan/MerlinToProcedureSimulationResultsAdapter.kt index ccbc56b0a1..7ccf27c528 100644 --- a/scheduler-driver/src/main/kotlin/gov/nasa/jpl/aerie/scheduler/plan/MerlinToProcedureSimulationResultsAdapter.kt +++ b/scheduler-driver/src/main/kotlin/gov/nasa/jpl/aerie/scheduler/plan/MerlinToProcedureSimulationResultsAdapter.kt @@ -1,6 +1,5 @@ package gov.nasa.jpl.aerie.scheduler.plan -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId import gov.nasa.jpl.aerie.merlin.driver.engine.ProfileSegment import gov.nasa.jpl.aerie.merlin.protocol.types.Duration import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue @@ -12,7 +11,8 @@ import gov.nasa.ammos.aerie.procedural.timeline.payloads.Segment import gov.nasa.ammos.aerie.procedural.timeline.payloads.activities.Instance import gov.nasa.ammos.aerie.procedural.timeline.plan.Plan import gov.nasa.ammos.aerie.procedural.timeline.plan.SimulationResults -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId +import gov.nasa.jpl.aerie.types.ActivityDirectiveId +import gov.nasa.jpl.aerie.types.ActivityInstanceId import java.time.Instant import kotlin.jvm.optionals.getOrNull @@ -108,7 +108,7 @@ class MerlinToProcedureSimulationResultsAdapter( instances.add(Instance( deserializer(serializedActivity), a.type, - ActivityInstanceId(a.spanId), + ActivityInstanceId(a.spanId), a.directiveId?.let { ActivityDirectiveId(it) }, Interval(startTime, endTime) )) diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/AnchorSchedulerTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/AnchorSchedulerTest.java index b09ef69b90..452b25e6a5 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/AnchorSchedulerTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/AnchorSchedulerTest.java @@ -5,8 +5,8 @@ import gov.nasa.jpl.aerie.merlin.driver.DirectiveTypeRegistry; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; import gov.nasa.jpl.aerie.merlin.driver.OneStepTask; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.SimulationResultsComputerInputs; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationResultsComparisonUtils.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationResultsComparisonUtils.java index 227e93b89e..3e4a983042 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationResultsComparisonUtils.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationResultsComparisonUtils.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.scheduler.simulation; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.engine.ProfileSegment; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GraphQLMerlinDatabaseService.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GraphQLMerlinDatabaseService.java index e0801bb649..d3b9998302 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GraphQLMerlinDatabaseService.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GraphQLMerlinDatabaseService.java @@ -4,8 +4,8 @@ import gov.nasa.jpl.aerie.constraints.model.LinearProfile; import gov.nasa.jpl.aerie.json.BasicParsers; import gov.nasa.jpl.aerie.json.JsonParser; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; +import gov.nasa.jpl.aerie.types.ActivityInstance; +import gov.nasa.jpl.aerie.types.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.UnfinishedActivity; import gov.nasa.jpl.aerie.merlin.driver.engine.EventRecord; diff --git a/scheduler-worker/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java b/scheduler-worker/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java index e73b4635b0..d8b793d0eb 100644 --- a/scheduler-worker/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java +++ b/scheduler-worker/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java @@ -22,7 +22,6 @@ import java.util.stream.Collectors; import gov.nasa.jpl.aerie.json.JsonParser; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; import gov.nasa.jpl.aerie.merlin.driver.MissionModelLoader; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; diff --git a/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityId.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityId.java new file mode 100644 index 0000000000..3d03863377 --- /dev/null +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityId.java @@ -0,0 +1,4 @@ +package gov.nasa.jpl.aerie.types; + +public interface ActivityId { +} diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstance.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityInstance.java similarity index 84% rename from merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstance.java rename to type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityInstance.java index 4fa9e27b24..36922a0589 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstance.java +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityInstance.java @@ -1,8 +1,7 @@ -package gov.nasa.jpl.aerie.merlin.driver; +package gov.nasa.jpl.aerie.types; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.time.Instant; import java.util.List; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstanceId.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityInstanceId.java similarity index 61% rename from merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstanceId.java rename to type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityInstanceId.java index eeb44b6a6c..2075be0415 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstanceId.java +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityInstanceId.java @@ -1,3 +1,3 @@ -package gov.nasa.jpl.aerie.merlin.driver; +package gov.nasa.jpl.aerie.types; public record ActivityInstanceId(long id) implements ActivityId {}