Archived
0

fix crawler deep

This commit is contained in:
Mo
2016-01-04 14:06:59 +03:00
parent 46df70d9f6
commit 276ae2f1d0
2 changed files with 3 additions and 7 deletions

View File

@@ -118,9 +118,7 @@ public class Crawler<T> {
if (t.isPresent()) {
setTarget(target);
if (count > 1 || s.isEntry(target)) {
int maxDeep = maxSize - (s.isEntry(target) ? graph.getMinJumps() * 2 : graph.getMinJumps());
if (maxDeep < 0) maxDeep = 0;
found = bfs(start(s), maxDeep, count);
found = bfs(start(s), graph.getMinLevel(), count);
} else {
found = dfs(start(s), t.get().getLevel() + 1);
}
@@ -155,9 +153,7 @@ public class Crawler<T> {
int found = 0;
if (t.isPresent()) {
setTarget(target);
int maxDeep = s.isEntry(target) ? maxSize - graph.getMinJumps() * 2 : graph.getMinLevel();
if (maxDeep < 0) maxDeep = 0;
found = ucs2(start(s), maxDeep, count);
found = ucs2(start(s), graph.getMinLevel(), count);
}
LOG.debug("Found {} paths", found);
callback.endSearch();

View File

@@ -16,7 +16,7 @@ public interface CrawlerSpecification<T> {
public int getGroupCount();
public default int getMinLands(){
return routeSpecification() != null ? routeSpecification().matchCount() : 0;
return routeSpecification() != null ? routeSpecification().matchCount() : 1;
}
}