Example #1
0
        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)));
        }
Example #2
0
        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);
            }
        }
Example #3
0
 public void AddStep(RoutePoint point)
 {
     _points.Add(point);
 }
Example #4
0
 public Route(RoutePoint start, RoutePoint end)
 {
     _points.Add(start);
     _points.Add(end);
 }
Example #5
0
 public Route(RoutePoint start)
 {
     _points.Add(start);
 }
Example #6
0
 public IEnumerable <RoutePoint> GetPotentialEndPoints(RoutePoint start, RoutePoint last)
 {
     return(GetPotentialEndPoints(start.Offer.Buying, last.Offer.Selling));
 }
Example #7
0
 public bool CanBeParentOf(RoutePoint point)
 {
     return(CanBeParentOf(point.Offer.Buying.Type));
 }
Example #8
0
 public bool CanBeChildOf(RoutePoint point)
 {
     return(CanBeChildOf(point.Offer.Selling.Type));
 }