src/model/pathfinding/ConcurrentPathFinder.java
private FutureTask<List<Direction>> createJob(int fromX, int fromY, int toX, int toY) {
        log.finest(String.format("Computing path from [%s, %s] to [%s, %s]", 
                fromX, fromY, toX, toY));
        FutureTask<List<Direction>> routeTask = new FutureTask<>(
                new AStarCallable(worldWrapper::isMovementObstruction, 
                fromX, fromY, toX, toY, Integer.MAX_VALUE));
        pendingJobs.put(Objects.hash(fromX, fromY, toX, toY), routeTask);
        log.finest(String.format("%s pending jobs", pendingJobs.size()));
        threadPool.execute(routeTask);
        return routeTask;
    }
/**
     * Creates the job specified by the argument, schedules it and returns the created FutureTask.
     */
Creates the job specified by the argument, schedules it and returns the created FutureTask.
Creates the job specified by the argument schedules it and returns the created FutureTask .
private FutureTask<List<Direction>> createJob(int fromX, int fromY, int toX, int toY) {
        log.finest(String.format("Computing path from [%s, %s] to [%s, %s]", 
                fromX, fromY, toX, toY));
        FutureTask<List<Direction>> routeTask = new FutureTask<>(
                new AStarCallable(worldWrapper::isMovementObstruction, 
                fromX, fromY, toX, toY, Integer.MAX_VALUE));
        pendingJobs.put(Objects.hash(fromX, fromY, toX, toY), routeTask);
        log.finest(String.format("%s pending jobs", pendingJobs.size()));
        threadPool.execute(routeTask);
        return routeTask;
    }
private FutureTask < List < Direction > > createJob ( int fromX , int fromY , int toX , int toY ) { log . finest ( String . format ( "Computing path from [%s, %s] to [%s, %s]" , fromX , fromY , toX , toY ) ) ; FutureTask < List < Direction > > routeTask = new FutureTask < > ( new AStarCallable ( worldWrapper :: isMovementObstruction , fromX , fromY , toX , toY , Integer . MAX_VALUE ) ) ; pendingJobs . put ( Objects . hash ( fromX , fromY , toX , toY ) , routeTask ) ; log . finest ( String . format ( "%s pending jobs" , pendingJobs . size ( ) ) ) ; threadPool . execute ( routeTask ) ; return routeTask ; }
Creates the job specified by the argument, schedules it and returns the created FutureTask.
Creates the job specified by the argument schedules it and returns the created FutureTask .