use of common.tree.ConcurrentVisitedTree in project solution-finder by knewjade.
the class ConcurrentCheckerNoHoldInvoker method search.
@Override
public List<Pair<Pieces, Boolean>> search(Field field, List<Pieces> searchingPieces, int maxClearLine, int maxDepth) throws FinderExecuteException {
ConcurrentVisitedTree visitedTree = new ConcurrentVisitedTree();
Obj obj = new Obj(field, maxClearLine, maxDepth, visitedTree);
ArrayList<Task> tasks = new ArrayList<>();
for (Pieces target : searchingPieces) tasks.add(new Task(obj, commonObj, target));
try {
return execute(tasks);
} catch (InterruptedException | ExecutionException e) {
throw new FinderExecuteException(e);
}
}
use of common.tree.ConcurrentVisitedTree in project solution-finder by knewjade.
the class SingleCheckerNoHoldInvoker method search.
@Override
public List<Pair<Pieces, Boolean>> search(Field field, List<Pieces> searchingPieces, int maxClearLine, int maxDepth) throws FinderExecuteException {
ConcurrentVisitedTree visitedTree = new ConcurrentVisitedTree();
Obj obj = new Obj(field, maxClearLine, maxDepth, visitedTree);
try {
ArrayList<Pair<Pieces, Boolean>> results = new ArrayList<>();
for (Pieces target : searchingPieces) {
Task task = new Task(obj, commonObj, target);
results.add(task.call());
}
return results;
} catch (Exception e) {
throw new FinderExecuteException(e);
}
}
use of common.tree.ConcurrentVisitedTree in project solution-finder by knewjade.
the class ConcurrentCheckerUsingHoldInvoker method search.
@Override
public List<Pair<Pieces, Boolean>> search(Field field, List<Pieces> searchingPieces, int maxClearLine, int maxDepth) throws FinderExecuteException {
ConcurrentVisitedTree visitedTree = new ConcurrentVisitedTree();
Obj obj = new Obj(field, maxClearLine, maxDepth, visitedTree);
ArrayList<Task> tasks = new ArrayList<>();
for (Pieces target : searchingPieces) tasks.add(new Task(obj, commonObj, target));
try {
return execute(tasks);
} catch (InterruptedException | ExecutionException e) {
throw new FinderExecuteException(e);
}
}
use of common.tree.ConcurrentVisitedTree in project solution-finder by knewjade.
the class SingleCheckerUsingHoldInvoker method search.
@Override
public List<Pair<Pieces, Boolean>> search(Field field, List<Pieces> searchingPieces, int maxClearLine, int maxDepth) throws FinderExecuteException {
ConcurrentVisitedTree visitedTree = new ConcurrentVisitedTree();
Obj obj = new Obj(field, maxClearLine, maxDepth, visitedTree);
ArrayList<Pair<Pieces, Boolean>> results = new ArrayList<>();
try {
for (Pieces target : searchingPieces) {
Task task = new Task(obj, commonObj, target);
Pair<Pieces, Boolean> call = task.call();
results.add(call);
}
} catch (Exception e) {
throw new FinderExecuteException(e);
}
// 結果をリストに追加する
return results;
}
Aggregations