class RouteChangedEventPublisher {

    void publishSolution(VehicleRoutingSolution solution) {
        RouteChangedEvent event = solutionToEvent(solution, this);
        logger.info(
                "New solution with {} depots, {} vehicles, {} visits, distance: {}, score: {}",
                solution.getDepotList().size(),
                solution.getVehicleList().size(),
                solution.getVisitList().size(),
                event.distance(),
                solution.getScore());
        logger.debug("Routes: {}", event.routes());
        eventPublisher.publishEvent(event);
    }

    @Autowired  RouteChangedEventPublisher(ApplicationEventPublisher eventPublisher);

}