Пример #1
0
        public TravelPath(DirectedWeightedSparseGraph <TravelHyperNode> graph, IEnumerable <TravelHyperNode> nodes)
        {
            StartStation    = null;
            TotalTime       = -1;
            ReservationTime = -1;
            Price           = -1;
            ReservationArc  = null;

            _nodepath = nodes.ToList();
            for (int i = 0; i < _nodepath.Count - 1; i++)
            {
                if (_nodepath[i].Price == 0 && _nodepath[i + 1].Price != 0)
                {
                    StartStation    = _nodepath[i].Station;
                    ReservationTime = Convert.ToInt32(_nodepath[i].Time);
                    Price           = _nodepath[i + 1].Price;
                    ReservationArc  = graph.GetEdge(_nodepath[i], _nodepath[i + 1]);
                }
            }
        }