Skip to content

Commit

Permalink
If scheduling has not simulated anything, do not store sim results
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienmaillard committed Oct 10, 2023
1 parent ec5ae50 commit bb267d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ public void initialSimulationResultsAreStale(){
this.initialPlanHasBeenModified = true;
}

/**
* @return true if initial simulation results are stale, false otherwise
*/
public boolean areInitialSimulationResultsStale(){
return this.initialPlanHasBeenModified;
}

public Optional<gov.nasa.jpl.aerie.constraints.model.SimulationResults> getLatestConstraintSimulationResults(){
if(!initialPlanHasBeenModified && initialSimulationResults.isPresent()) return Optional.of(this.initialSimulationResults.get().constraintsResults());
if(lastSimulationData == null) return Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ private Optional<DatasetId> storeSimulationResults(PlanningHorizon planningHoriz
final Map<SchedulingActivityDirective, ActivityDirectiveId> schedDirectiveToMerlinId)
throws MerlinServiceException, IOException
{
if(!simulationFacade.areInitialSimulationResultsStale()) return Optional.empty();
//finish simulation until end of horizon before posting results
try {
simulationFacade.computeSimulationResultsUntil(planningHorizon.getEndAerie());
Expand Down

0 comments on commit bb267d1

Please sign in to comment.