Exemplo n.º 1
0
        public static void Refresh()
        {
            var db = DB.NewContext();

            ProfileMaintainer.ComputeDayWeights();
            DCC.Refresh(db);
            AxesBuilder.UpdateOrigin(db);
            ProfileMaintainer.Refresh(db);
        }
Exemplo n.º 2
0
        public static void Persist()
        {
            var db = DB.NewContext();

            DCC.Persist(db);

            AxesBuilder.Persist(db);
            try
            {
                db.SaveChanges();
            }
            catch (Exception)
            {
                foreach (var h in db.ClusterHistories)
                {
                    if (double.IsNaN(h.F))
                    {
                        System.Windows.Forms.MessageBox.Show("F");
                    }
                    else if (double.IsNaN(h.W))
                    {
                        System.Windows.Forms.MessageBox.Show("W");
                    }
                    else if (double.IsNaN(h.T))
                    {
                        System.Windows.Forms.MessageBox.Show("T");
                    }
                    else if (double.IsInfinity(h.F))
                    {
                        System.Windows.Forms.MessageBox.Show("F");
                    }
                    else if (double.IsInfinity(h.W))
                    {
                        System.Windows.Forms.MessageBox.Show("W");
                    }
                    else if (double.IsInfinity(h.T))
                    {
                        System.Windows.Forms.MessageBox.Show("T");
                    }
                }
                foreach (var h in db.GroupRateHistories)
                {
                    if (double.IsNaN(h.Rate))
                    {
                        System.Windows.Forms.MessageBox.Show("F");
                    }
                    else if (double.IsInfinity(h.Rate))
                    {
                        System.Windows.Forms.MessageBox.Show("W");
                    }
                }
                throw;
            }
        }
Exemplo n.º 3
0
        public void AddTuple(DataSetTuple dataSetTuple)
        {
            _lifeTime  = 0;
            _weight    = 0;
            _frequency = 0;

            DataAggregatorTuple tuple = new DataAggregatorTuple();

            tuple.OldFeatures.Frequency = this.Frequency;
            tuple.OldFeatures.Weight    = this.Weight;
            tuple.OldFeatures.LifeTime  = this.LifeTime;

            this.DataSetTuples.Add(dataSetTuple);

            tuple.NewFeatures.Frequency = this.Frequency;
            tuple.NewFeatures.Weight    = this.Weight;
            tuple.NewFeatures.LifeTime  = this.LifeTime;

            tuple.SourceCluster = this;
            tuple.StartTime     = this.StartTime;
            DCC.Receive(tuple);
        }
Exemplo n.º 4
0
        public void Purge(double newT0)
        {
            _lifeTime  = 0;
            _weight    = 0;
            _frequency = 0;

            DataAggregatorTuple tuple = new DataAggregatorTuple();

            tuple.OldFeatures.Frequency = this.Frequency;
            tuple.OldFeatures.Weight    = this.Weight;
            tuple.OldFeatures.LifeTime  = this.LifeTime;

            this.DataSetTuples.RemoveAll(x => x.StartTime < newT0);

            tuple.NewFeatures.Frequency = this.Frequency;
            tuple.NewFeatures.Weight    = this.Weight;
            tuple.NewFeatures.LifeTime  = this.LifeTime;

            tuple.SourceCluster = this;
            tuple.StartTime     = this.StartTime;

            DCC.Receive(tuple);
        }