public IEnumerable <RoutePoint> GetPotentialNextPoints(RoutePoint point) { if (!IsPoolGenerated) { _logger.Error("Cannot GetPotentialNextValues when RoutePool is not generated yet!"); return(null); } return(_pool.GetPoints().Where(next => next.CanBeChildOf(point))); }
private void ProcessOffer(OfferCollection offerCollection) { foreach (var currency in _runner.OfferData.Keys) { if (offerCollection.BuyingType == currency) { continue; } var appraised = offerCollection.Appraise(currency); var offers = new List <Offer>(offerCollection.GetTrimmedOffers(currency)); var nearestOffer = offers.MinBy(offer => Math.Abs((int)appraised - offer.Ratio)).First(); var point = new RoutePoint(nearestOffer); _points.Add(point); } }
public void AddStep(RoutePoint point) { _points.Add(point); }
public Route(RoutePoint start, RoutePoint end) { _points.Add(start); _points.Add(end); }
public Route(RoutePoint start) { _points.Add(start); }
public IEnumerable <RoutePoint> GetPotentialEndPoints(RoutePoint start, RoutePoint last) { return(GetPotentialEndPoints(start.Offer.Buying, last.Offer.Selling)); }
public bool CanBeParentOf(RoutePoint point) { return(CanBeParentOf(point.Offer.Buying.Type)); }
public bool CanBeChildOf(RoutePoint point) { return(CanBeChildOf(point.Offer.Selling.Type)); }