Esempio n. 1
0
 public static List<List<DatesEdge>> GetAllCyclesAsEdges(TrackVariantGraph g)
 {
     _g = g;
     _cycles.Clear();
     g.Verteces.ToList().ForEach(v => Traverse(v));
     return TransformVertecesCycleToEdges();
 }
Esempio n. 2
0
 public static List<List<DateVertex>> GetAllCyclesAsVerteces(TrackVariantGraph g)
 {
     _g = g;
     _cycles.Clear();
     g.Verteces.ToList().ForEach(v => Traverse(v));
     return _cycles;
 }
Esempio n. 3
0
        private void LoadGraph()
        {
            _tvg = new TrackVariantGraph();
            var list = new List<IntraTrackStarterInfo>();
            string currentHorse = "";

            _trackCodeMap.Clear();
            _trackSurfaceMap.Clear();

            foreach (var starterInfo in _dbCollection)
            {
                if (starterInfo.HorseName != currentHorse)
                {
                    AddDataPointsToGraph(list);
                    list.Clear();
                    currentHorse = starterInfo.HorseName;
                }

                list.Add(starterInfo);
            }

            AddDataPointsToGraph(list);

            _tbTotalNumberOfVertices.Text = _tvg.Verteces.Count().ToString();
            _tbTotalNumberOfEdges.Text = _tvg.GetAllAvailableEdges().Count.ToString();
        }
Esempio n. 4
0
        private void Initialize()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                _tvg = new TrackVariantGraph();
                _starterInfoCollection.SelectedLoadingMethod = (StarterInfoCollection.LoadingMethod)_cbLoadingMethod.SelectedItem ;
                _starterInfoCollection.Load(_trackCode, _surface);
                _tbNumberOfHorses.Text = _starterInfoCollection.Count.ToString();

                LoadGraph();
                _tvg.InitializeVariant();
                UpdateDisplay();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }