Skip to content

Commit

Permalink
Avoid simulating activities that have already been simulated
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienmaillard committed Jun 9, 2023
1 parent bde24e4 commit b1cfdbb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ public void replaceActivityFromSimulation(final SchedulingActivityDirective toBe

public void simulateActivities(final Collection<SchedulingActivityDirective> activities) throws SimulationException {
final var activitiesSortedByStartTime =
activities.stream().sorted(Comparator.comparing(SchedulingActivityDirective::startOffset)).toList();
activities.stream().filter(activity -> !(insertedActivities.containsKey(activity)))
.sorted(Comparator.comparing(SchedulingActivityDirective::startOffset)).toList();
if(activitiesSortedByStartTime.isEmpty()) return;
final Map<ActivityDirectiveId, ActivityDirective> directivesToSimulate = new HashMap<>();

for(final var activity : activitiesSortedByStartTime){
Expand Down

0 comments on commit b1cfdbb

Please sign in to comment.