-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1509 from NASA-AMMOS/refactor/scheduling-ids-joel
Refactor directive IDs in the scheduler
- Loading branch information
Showing
81 changed files
with
1,385 additions
and
1,453 deletions.
There are no files selected for viewing
51 changes: 25 additions & 26 deletions
51
constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,41 @@ | ||
package gov.nasa.jpl.aerie.constraints.model; | ||
|
||
import gov.nasa.jpl.aerie.constraints.time.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.SerializedValue; | ||
|
||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.Optional; | ||
|
||
public final class ActivityInstance { | ||
public final long id; | ||
public final String type; | ||
public final Map<String, SerializedValue> parameters; | ||
public final Interval interval; | ||
|
||
public record ActivityInstance( | ||
ActivityInstanceId instanceId, | ||
String type, | ||
Map<String, SerializedValue> parameters, | ||
Interval interval, | ||
Optional<ActivityDirectiveId> directiveId | ||
) { | ||
public ActivityInstance( | ||
final long id, | ||
final String type, | ||
final Map<String, SerializedValue> parameters, | ||
final Interval interval | ||
long id, | ||
String type, | ||
Map<String, SerializedValue> parameters, | ||
Interval interval | ||
) { | ||
this.type = type; | ||
this.id = id; | ||
this.parameters = parameters; | ||
this.interval = interval; | ||
this(id, type, parameters, interval, Optional.empty()); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (!(obj instanceof ActivityInstance)) return false; | ||
final var o = (ActivityInstance)obj; | ||
|
||
return Objects.equals(this.id, o.id) && | ||
Objects.equals(this.type, o.type) && | ||
Objects.equals(this.parameters, o.parameters) && | ||
Objects.equals(this.interval, o.interval); | ||
public ActivityInstance( | ||
long id, | ||
String type, | ||
Map<String, SerializedValue> parameters, | ||
Interval interval, | ||
Optional<ActivityDirectiveId> directiveId | ||
) { | ||
this(new ActivityInstanceId(id), type, parameters, interval, directiveId); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(this.id, this.type, this.parameters, this.interval); | ||
public long id() { | ||
return this.instanceId().id(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstanceId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package gov.nasa.jpl.aerie.merlin.driver; | ||
|
||
public record ActivityInstanceId(long id) {} |
3 changes: 0 additions & 3 deletions
3
merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulatedActivityId.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.