test_class.declarator: solution = SolutionFactory.emptySolution()
test_class.modifier: private final
test_class.original_string: private final VehicleRoutingSolution solution = SolutionFactory.emptySolution();
test_class.type: VehicleRoutingSolution
test_class.var_name: solution
test_class.declarator: testVehicle = PlanningVehicleFactory.testVehicle(1)
test_class.modifier: private final
test_class.original_string: private final PlanningVehicle testVehicle = PlanningVehicleFactory.testVehicle(1);
test_class.type: PlanningVehicle
test_class.var_name: testVehicle
test_class.declarator: testVisit = PlanningVisitFactory.testVisit(1)
test_class.modifier: private final
test_class.original_string: private final PlanningVisit testVisit = PlanningVisitFactory.testVisit(1);
test_class.type: PlanningVisit
test_class.var_name: testVisit
test_class.declarator: solutionArgumentCaptor
test_class.modifier: @Captor
      private
test_class.original_string: @Captor
      private ArgumentCaptor<VehicleRoutingSolution> solutionArgumentCaptor;
test_class.type: ArgumentCaptor<VehicleRoutingSolution>
test_class.var_name: solutionArgumentCaptor
test_class.declarator: bestSolutionChangedEvent
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent;
test_class.type: BestSolutionChangedEvent<VehicleRoutingSolution>
test_class.var_name: bestSolutionChangedEvent
test_class.declarator: solverFuture
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ListenableFuture<VehicleRoutingSolution> solverFuture;
test_class.type: ListenableFuture<VehicleRoutingSolution>
test_class.var_name: solverFuture
test_class.declarator: solver
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Solver<VehicleRoutingSolution> solver;
test_class.type: Solver<VehicleRoutingSolution>
test_class.var_name: solver
test_class.declarator: executor
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AsyncListenableTaskExecutor executor;
test_class.type: AsyncListenableTaskExecutor
test_class.var_name: executor
test_class.declarator: routeChangedEventPublisher
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private RouteChangedEventPublisher routeChangedEventPublisher;
test_class.type: RouteChangedEventPublisher
test_class.var_name: routeChangedEventPublisher
test_class.declarator: solverManager
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private SolverManager solverManager;
test_class.type: SolverManager
test_class.var_name: solverManager
test_class.file: optaweb-vehicle-routing-backend/src/test/java/org/optaweb/vehiclerouting/plugin/planner/SolverManagerTest.java
test_class.identifier: SolverManagerTest
test_case.body: @Test
      void ignore_new_best_solutions_when_unprocessed_fact_changes() {
          // arrange
          when(bestSolutionChangedEvent.isEveryProblemFactChangeProcessed()).thenReturn(false);
  
          // act
          solverManager.bestSolutionChanged(bestSolutionChangedEvent);
  
          // assert
          verify(bestSolutionChangedEvent, never()).getNewBestSolution();
          verify(routeChangedEventPublisher, never()).publishSolution(any());
      }
test_case.class_method_signature: SolverManagerTest.ignore_new_best_solutions_when_unprocessed_fact_changes()
test_case.full_signature: @Test void ignore_new_best_solutions_when_unprocessed_fact_changes()
test_case.identifier: ignore_new_best_solutions_when_unprocessed_fact_changes
test_case.invocations: thenReturn when isEveryProblemFactChangeProcessed bestSolutionChanged getNewBestSolution verify never publishSolution verify never any
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void ignore_new_best_solutions_when_unprocessed_fact_changes()
focal_class.declarator: logger = LoggerFactory.getLogger(SolverManager.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(SolverManager.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: solver
focal_class.modifier: private final
focal_class.original_string: private final Solver<VehicleRoutingSolution> solver;
focal_class.type: Solver<VehicleRoutingSolution>
focal_class.var_name: solver
focal_class.declarator: executor
focal_class.modifier: private final
focal_class.original_string: private final AsyncListenableTaskExecutor executor;
focal_class.type: AsyncListenableTaskExecutor
focal_class.var_name: executor
focal_class.declarator: routeChangedEventPublisher
focal_class.modifier: private final
focal_class.original_string: private final RouteChangedEventPublisher routeChangedEventPublisher;
focal_class.type: RouteChangedEventPublisher
focal_class.var_name: routeChangedEventPublisher
focal_class.declarator: eventPublisher
focal_class.modifier: private final
focal_class.original_string: private final ApplicationEventPublisher eventPublisher;
focal_class.type: ApplicationEventPublisher
focal_class.var_name: eventPublisher
focal_class.declarator: solverFuture
focal_class.modifier: private
focal_class.original_string: private ListenableFuture<VehicleRoutingSolution> solverFuture;
focal_class.type: ListenableFuture<VehicleRoutingSolution>
focal_class.var_name: solverFuture
focal_class.file: optaweb-vehicle-routing-backend/src/main/java/org/optaweb/vehiclerouting/plugin/planner/SolverManager.java
focal_class.identifier: SolverManager
focal_class.interfaces: implements SolverEventListener<VehicleRoutingSolution>
focal_class.class_method_signature: SolverManager.SolverManager(
              Solver<VehicleRoutingSolution> solver,
              AsyncListenableTaskExecutor executor,
              RouteChangedEventPublisher routeChangedEventPublisher,
              ApplicationEventPublisher eventPublisher)
focal_class.full_signature: @Autowired  SolverManager(
              Solver<VehicleRoutingSolution> solver,
              AsyncListenableTaskExecutor executor,
              RouteChangedEventPublisher routeChangedEventPublisher,
              ApplicationEventPublisher eventPublisher)
focal_class.identifier: SolverManager
focal_class.modifiers: @Autowired
focal_class.parameters: (
              Solver<VehicleRoutingSolution> solver,
              AsyncListenableTaskExecutor executor,
              RouteChangedEventPublisher routeChangedEventPublisher,
              ApplicationEventPublisher eventPublisher)
focal_class.signature:  SolverManager(
              Solver<VehicleRoutingSolution> solver,
              AsyncListenableTaskExecutor executor,
              RouteChangedEventPublisher routeChangedEventPublisher,
              ApplicationEventPublisher eventPublisher)
focal_class.class_method_signature: SolverManager.bestSolutionChanged(BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent)
focal_class.full_signature: @Override public void bestSolutionChanged(BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent)
focal_class.identifier: bestSolutionChanged
focal_class.modifiers: @Override public
focal_class.parameters: (BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent)
focal_class.return: void
focal_class.signature: void bestSolutionChanged(BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent)
focal_class.class_method_signature: SolverManager.startSolver(VehicleRoutingSolution solution)
focal_class.full_signature:  void startSolver(VehicleRoutingSolution solution)
focal_class.identifier: startSolver
focal_class.parameters: (VehicleRoutingSolution solution)
focal_class.return: void
focal_class.signature: void startSolver(VehicleRoutingSolution solution)
focal_class.class_method_signature: SolverManager.stopSolver()
focal_class.full_signature:  void stopSolver()
focal_class.identifier: stopSolver
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void stopSolver()
focal_class.class_method_signature: SolverManager.assertSolverIsAlive()
focal_class.full_signature: private void assertSolverIsAlive()
focal_class.identifier: assertSolverIsAlive
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void assertSolverIsAlive()
focal_class.class_method_signature: SolverManager.addVisit(PlanningVisit visit)
focal_class.full_signature:  void addVisit(PlanningVisit visit)
focal_class.identifier: addVisit
focal_class.parameters: (PlanningVisit visit)
focal_class.return: void
focal_class.signature: void addVisit(PlanningVisit visit)
focal_class.class_method_signature: SolverManager.removeVisit(PlanningVisit visit)
focal_class.full_signature:  void removeVisit(PlanningVisit visit)
focal_class.identifier: removeVisit
focal_class.parameters: (PlanningVisit visit)
focal_class.return: void
focal_class.signature: void removeVisit(PlanningVisit visit)
focal_class.class_method_signature: SolverManager.addVehicle(PlanningVehicle vehicle)
focal_class.full_signature:  void addVehicle(PlanningVehicle vehicle)
focal_class.identifier: addVehicle
focal_class.parameters: (PlanningVehicle vehicle)
focal_class.return: void
focal_class.signature: void addVehicle(PlanningVehicle vehicle)
focal_class.class_method_signature: SolverManager.removeVehicle(PlanningVehicle vehicle)
focal_class.full_signature:  void removeVehicle(PlanningVehicle vehicle)
focal_class.identifier: removeVehicle
focal_class.parameters: (PlanningVehicle vehicle)
focal_class.return: void
focal_class.signature: void removeVehicle(PlanningVehicle vehicle)
focal_class.class_method_signature: SolverManager.changeCapacity(PlanningVehicle vehicle)
focal_class.full_signature:  void changeCapacity(PlanningVehicle vehicle)
focal_class.identifier: changeCapacity
focal_class.parameters: (PlanningVehicle vehicle)
focal_class.return: void
focal_class.signature: void changeCapacity(PlanningVehicle vehicle)
focal_method.body: @Override
      public void bestSolutionChanged(BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent) {
          // CAUTION! This runs on the solver thread. Implications:
          // 1. The method should be as quick as possible to avoid blocking solver unnecessarily.
          // 2. This place is a potential source of race conditions.
          if (!bestSolutionChangedEvent.isEveryProblemFactChangeProcessed()) {
              logger.info("Ignoring a new best solution that has some problem facts missing");
              return;
          }
          // TODO Race condition, if a servlet thread deletes that location in the middle of this method happening
          //      on the solver thread. Make sure that location is still in the repository.
          //      Maybe repair the solution OR ignore if it's inconsistent (log a WARNING).
          routeChangedEventPublisher.publishSolution(bestSolutionChangedEvent.getNewBestSolution()); // TODO @Async
      }
focal_method.class_method_signature: SolverManager.bestSolutionChanged(BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent)
focal_method.full_signature: @Override public void bestSolutionChanged(BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent)
focal_method.identifier: bestSolutionChanged
focal_method.invocations: isEveryProblemFactChangeProcessed info publishSolution getNewBestSolution
focal_method.modifiers: @Override public
focal_method.parameters: (BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent)
focal_method.return: void
focal_method.signature: void bestSolutionChanged(BestSolutionChangedEvent<VehicleRoutingSolution> bestSolutionChangedEvent)