fix crawler deep
This commit is contained in:
@@ -118,9 +118,7 @@ public class Crawler<T> {
|
|||||||
if (t.isPresent()) {
|
if (t.isPresent()) {
|
||||||
setTarget(target);
|
setTarget(target);
|
||||||
if (count > 1 || s.isEntry(target)) {
|
if (count > 1 || s.isEntry(target)) {
|
||||||
int maxDeep = maxSize - (s.isEntry(target) ? graph.getMinJumps() * 2 : graph.getMinJumps());
|
found = bfs(start(s), graph.getMinLevel(), count);
|
||||||
if (maxDeep < 0) maxDeep = 0;
|
|
||||||
found = bfs(start(s), maxDeep, count);
|
|
||||||
} else {
|
} else {
|
||||||
found = dfs(start(s), t.get().getLevel() + 1);
|
found = dfs(start(s), t.get().getLevel() + 1);
|
||||||
}
|
}
|
||||||
@@ -155,9 +153,7 @@ public class Crawler<T> {
|
|||||||
int found = 0;
|
int found = 0;
|
||||||
if (t.isPresent()) {
|
if (t.isPresent()) {
|
||||||
setTarget(target);
|
setTarget(target);
|
||||||
int maxDeep = s.isEntry(target) ? maxSize - graph.getMinJumps() * 2 : graph.getMinLevel();
|
found = ucs2(start(s), graph.getMinLevel(), count);
|
||||||
if (maxDeep < 0) maxDeep = 0;
|
|
||||||
found = ucs2(start(s), maxDeep, count);
|
|
||||||
}
|
}
|
||||||
LOG.debug("Found {} paths", found);
|
LOG.debug("Found {} paths", found);
|
||||||
callback.endSearch();
|
callback.endSearch();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public interface CrawlerSpecification<T> {
|
|||||||
public int getGroupCount();
|
public int getGroupCount();
|
||||||
|
|
||||||
public default int getMinLands(){
|
public default int getMinLands(){
|
||||||
return routeSpecification() != null ? routeSpecification().matchCount() : 0;
|
return routeSpecification() != null ? routeSpecification().matchCount() : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user