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