Archived
0

fix compare route on rebuild path

This commit is contained in:
iMoHax
2015-01-17 11:44:37 +03:00
parent 4b0c2f0a0e
commit 52a095bf6d

View File

@@ -371,7 +371,7 @@ public class MarketAnalyzer {
//TODO: implement search with constant length //TODO: implement search with constant length
Collection<PathRoute> paths = searcher.getPaths(from, vendors, jumps, balance, cargo, limit); Collection<PathRoute> paths = searcher.getPaths(from, vendors, jumps, balance, cargo, limit);
Optional<PathRoute> route = paths.stream().filter(p -> p.contains(vendors)).findFirst(); Optional<PathRoute> route = paths.stream().filter(p -> p.contains(vendors)).findFirst();
if (route.isPresent() && (res == null || RouteGraph.byProfitComparator.compare(res, route.get()) < 0)){ if (route.isPresent() && (res == null || RouteGraph.byProfitComparator.compare(res, route.get()) > 0)){
res = route.get(); res = route.get();
} }
callback.inc(); callback.inc();