From 276ae2f1d0406b5d33f170b10950c1faf1df515f Mon Sep 17 00:00:00 2001 From: Mo Date: Mon, 4 Jan 2016 14:06:59 +0300 Subject: [PATCH] fix crawler deep --- core/src/main/java/ru/trader/analysis/graph/Crawler.java | 8 ++------ .../ru/trader/analysis/graph/CrawlerSpecification.java | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/ru/trader/analysis/graph/Crawler.java b/core/src/main/java/ru/trader/analysis/graph/Crawler.java index db021c2..fc3489f 100644 --- a/core/src/main/java/ru/trader/analysis/graph/Crawler.java +++ b/core/src/main/java/ru/trader/analysis/graph/Crawler.java @@ -118,9 +118,7 @@ public class Crawler { 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 { 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(); diff --git a/core/src/main/java/ru/trader/analysis/graph/CrawlerSpecification.java b/core/src/main/java/ru/trader/analysis/graph/CrawlerSpecification.java index c9b0a68..08b2ac2 100644 --- a/core/src/main/java/ru/trader/analysis/graph/CrawlerSpecification.java +++ b/core/src/main/java/ru/trader/analysis/graph/CrawlerSpecification.java @@ -16,7 +16,7 @@ public interface CrawlerSpecification { public int getGroupCount(); public default int getMinLands(){ - return routeSpecification() != null ? routeSpecification().matchCount() : 0; + return routeSpecification() != null ? routeSpecification().matchCount() : 1; } }