public StreamMovingAverageInterpolater(IEnumerable <double> ys, int order = 10)
 {
     this.Ys       = ys;
     this.Order    = order;
     this.Currents = new List <double>();
     YEnumer       = Ys.GetEnumerator();
 }
Ejemplo n.º 2
0
            public Zs(int ys, int xs)
            {
                int i = 0;

                y = new Ys[ys];
                for (i = 0; i < ys; i++)
                {
                    y[i] = new Ys(xs);
                }
            }
Ejemplo n.º 3
0
        public void ReadTestingInfo()
        {
            TobiiCSVRead(Name, tobiiList);
            Dictionary <long, double> avgs = CompactifyTobiiList(tobiiList, SmoothInterval);

            foreach (var item in avgs)
            {
                Ys.Add(item.Value);
                Xs.Add(item.Key);
            }
        }
 public FallModelingResultViewModel(List <double> ts, List <double> ys, List <double> vs)
 {
     for (int i = 0; i < ts.Count; ++i)
     {
         Ys.Add(new ObservablePoint(ts[i], ys[i]));
         Vs.Add(new ObservablePoint(ts[i], vs[i]));
     }
     Collection.Add(new LineSeries()
     {
         Values = Ys
     });
 }
Ejemplo n.º 5
0
        public double TotalSS()
        {
            // compute total sum of squares
            double ybar = Ys.Average();
            double sst  = 0;

            for (int i = Ys.GetLowerBound(0); i <= Ys.GetUpperBound(0); i++)
            {
                sst += Math.Pow(Ys[i] - ybar, 2);
            }

            return(sst);
        }
Ejemplo n.º 6
0
        public void AddLedgerline(double newY, double gap)
        {
            if (Ys.Count == 0)
            {
                _top    = newY - (gap / 2F);
                _bottom = newY + (gap / 2F);
            }
            else
            {
                _bottom = newY + (gap / 2F);
            }

            Ys.Add(newY);
        }
Ejemplo n.º 7
0
 public void updateFlight(CAT10 listcat10, int i)
 {
     if (this.callsign == null && listcat10.TargetID != null)
     {
         this.callsign = listcat10.TargetID;
     }
     packages.Add(i);
     Xs.Add(Convert.ToDouble(listcat10.Xcomponent));
     Ys.Add(Convert.ToDouble(listcat10.Ycomponent));
     fls.Add(listcat10.FlightLevel);
     Vxs.Add(Convert.ToDouble(listcat10.Vx));
     Vys.Add(Convert.ToDouble(listcat10.Vy));
     TODs.Add(listcat10.TimeOfDay);
 }
Ejemplo n.º 8
0
 public void updateFlight(CAT20 listcat20, int i)
 {
     if (this.callsign == null && listcat20.callsign != null)
     {
         this.callsign = listcat20.callsign;
     }
     packages.Add(i);
     Xs.Add(listcat20.X);
     Ys.Add(listcat20.Y);
     fls.Add(listcat20.FL[2]);
     Vxs.Add(listcat20.Vx);
     Vys.Add(listcat20.Vy);
     TODs.Add(listcat20.TOD);
 }
Ejemplo n.º 9
0
        public void Update()
        {
            int tempX = HeadX;
            int tempY = HeadY;

            HeadX = HeadX + XDir;
            HeadY = HeadY + YDir;

            Xs.Insert(0, tempX);
            Ys.Insert(0, tempY);

            Render(Xs[Xs.Count - 1], Ys[Ys.Count - 1], HeadX, HeadY);
            Xs.RemoveAt(Xs.Count - 1);
            Ys.RemoveAt(Ys.Count - 1);
        }
Ejemplo n.º 10
0
        public Flight(CAT10 listcat10, int i)
        {
            this.callsign    = listcat10.TargetID;
            this.CAT         = 20;
            this.tracknumber = listcat10.TrackNumber;
            this.messagetype = listcat10.MessageType;
            this.SIC         = Convert.ToInt32(listcat10.SICnum);
            this.SAC         = Convert.ToInt32(listcat10.SACnum);

            packages.Add(i);
            Xs.Add(Convert.ToDouble(listcat10.Xcomponent));
            Ys.Add(Convert.ToDouble(listcat10.Ycomponent));
            fls.Add(listcat10.FlightLevel);
            Vxs.Add(Convert.ToDouble(listcat10.Vx));
            Vys.Add(Convert.ToDouble(listcat10.Vy));
            TODs.Add(listcat10.TimeOfDay);
        }
Ejemplo n.º 11
0
        public Flight(CAT20 listcat20, int i)
        {
            this.callsign    = listcat20.callsign;
            this.CAT         = 20;
            this.tracknumber = listcat20.TrackNum;
            this.messagetype = "MLAT";
            this.SIC         = listcat20.SIC;
            this.SAC         = listcat20.SAC;

            packages.Add(i);
            Xs.Add(listcat20.X);
            Ys.Add(listcat20.Y);
            fls.Add(listcat20.FL[2]);
            Vxs.Add(listcat20.Vx);
            Vys.Add(listcat20.Vy);
            TODs.Add(listcat20.TOD);
        }
 public FallModelingResultViewModel(List <double> ts, List <double> ys, List <double> vs, List <double> ays, List <double> avs)
 {
     for (int i = 0; i < ts.Count; ++i)
     {
         Ys.Add(new ObservablePoint(ts[i], ys[i]));
         Vs.Add(new ObservablePoint(ts[i], vs[i]));
         AnaliticalYs.Add(new ObservablePoint(ts[i], ays[i]));
         AnaliticalVs.Add(new ObservablePoint(ts[i], avs[i]));
     }
     Collection.Add(new LineSeries()
     {
         Values = Ys
     });
     Collection.Add(new LineSeries()
     {
         Values = AnaliticalYs
     });
     hasAnaliticalSolution = true;
 }
Ejemplo n.º 13
0
 void addY(int val)
 {
     if (Ys.Count > 0)
     {
         int lastY = Ys[Ys.Count - 1];
         if (val > lastY)
         {
             for (int i = lastY; i < val; i++)
             {
                 Ys.Add(i);
                 Xs.Add(curX += 1);
             }
         }
         else if (val < lastY)
         {
             for (int i = lastY; i > val; i--)
             {
                 Ys.Add(i);
                 Xs.Add(curX += 1);
             }
         }
         else
         {
             Xs.Add(curX += 1);
             Ys.Add(val);
         }
     }
     else
     {
         Ys.Add(1);
         Xs.Add(curX += 1);
     }
     if (Xs.Count > pictureBox1.Width)
     {
         Xs.RemoveAt(0);
         Ys.RemoveAt(0);
         difference++;
     }
 }
Ejemplo n.º 14
0
 public void Grow(Fruit fruit)
 {
     Ys.Insert(0, fruit.Y);
     Xs.Insert(0, fruit.X);
     Render(fruit.X, fruit.Y);
 }
Ejemplo n.º 15
0
 public int N()
 {
     return(Ys.Count());
 }
 void UpdateTreatmentGraphWithResidualData(bool OnlyShowFitted = false, bool ShowLinearResiduals = false, bool showQuadResiduals = false)
 {
     this.Cursor = Cursors.WaitCursor;
     try
     {
         GraphPane Graph = plotTreatments.GraphPane;
         Graph.CurveList.Clear();
         Graph.Title.Text           = "Growth Plots";
         Graph.XAxis.Title.Text     = "Hours";
         Graph.YAxis.Title.Text     = "Residuals";
         Graph.Legend.Position      = LegendPos.InsideTopLeft;
         Graph.Legend.FontSpec.Size = 8f;
         Graph.Legend.IsHStack      = true;
         SymbolType SymboltoUse = SymbolType.Circle;
         Dictionary <string, GrowthCurve> curData = GetDictionaryOfGrowthRateData();
         for (int i = 1; i < SelectablePlateMap.MAX_GROUP_ASSIGNMENTS; i++)
         {
             Color  groupColor;
             var    curNames  = selectablePlateMap1.GetNamesOfWellsAssignedToGroup(i, out groupColor);
             string GroupName = "";
             if (TreatmentTextBoxes[i] != null)
             {
                 GroupName = TreatmentTextBoxes[i].Text;
             }
             if (GroupName == "")
             {
                 GroupName = "Treatment: " + i.ToString();
             }
             foreach (string name in curNames)
             {
                 if (curData.ContainsKey(name))
                 {
                     GrowthCurve   GD = curData[name];
                     PointPairList XY;
                     List <double> Xs;
                     List <double> Ys;
                     if (ShowLinearResiduals)
                     {
                         Xs = new List <double>();
                         Ys = new List <double>();
                         if (GD.LinFit != null)
                         {
                             Xs.AddRange(GD.LinFit.X);
                             Ys.AddRange(GD.LinFit.ReturnResidualsAfterExpTransform());
                         }
                     }
                     else if (showQuadResiduals)
                     {
                         Xs = new List <double>();
                         Ys = new List <double>();
                         if (GD.QuadModel != null && GD.QuadModel.SuccessfulFit)
                         {
                             Xs.AddRange(GD.QuadModel.X);
                             Ys.AddRange(GD.QuadModel.ReturnResidualsAfterExpTransform);
                         }
                     }
                     else
                     {
                         GD.GetResiduals(OnlyShowFitted, out Xs, out Ys);
                         XY = new PointPairList(Xs.ToArray(), Ys.ToArray());
                         //GD.LinFit.GetResiduals(out Xs, out Ys);
                     }
                     XY = new PointPairList(Xs.ToArray(), Ys.ToArray());
                     Graph.AddCurve(GroupName, XY, groupColor, SymboltoUse);
                 }
             }
         }
         if (chkTreatLegend.Checked)
         {
             Graph.Legend.IsVisible = true;
         }
         else
         {
             Graph.Legend.IsVisible = false;
         }
         Graph.XAxis.Scale.MaxGrace = .05;
         plotTreatments.AxisChange();
         plotTreatments.Invalidate();
         this.Cursor = Cursors.Default;
     }
     catch (Exception thrown)
     { MessageBox.Show("Could not make graph, talk to nigel.\n\nError is:\n" + thrown.Message, "Graph Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
     finally { this.Cursor = Cursors.Default; }
 }