Фoрмування мнoжини oптимальних рiшень за критерiєм Байєcа–Лаплаcа при екcпoненцiйнo рoзпoдiлених даних

Курсовой проект - Компьютеры, программирование

Другие курсовые по предмету Компьютеры, программирование

Visible = false;

this.tChart1.Axes.Bottom.Title.Font.Shadow.Visible = false;

this.tChart1.Axes.Bottom.Title.Shadow.Visible = false;

//

//

//

this.tChart1.Axes.Depth.Automatic = true;

this.tChart1.Axes.Depth.Grid.ZPosition = 0;

this.tChart1.Axes.Depth.Labels.Font.Shadow.Visible = false;

//

//

//

this.tChart1.Axes.Depth.Labels.Shadow.Visible = false;

this.tChart1.Axes.Depth.Title.Font.Shadow.Visible = false;

this.tChart1.Axes.Depth.Title.Shadow.Visible = false;

this.tChart1.Axes.DepthTop.Automatic = true;

this.tChart1.Axes.DepthTop.Grid.ZPosition = 0;

this.tChart1.Axes.DepthTop.Labels.Font.Shadow.Visible = false;

this.tChart1.Axes.DepthTop.Labels.Shadow.Visible = false;

this.tChart1.Axes.DepthTop.Title.Font.Shadow.Visible = false;

this.tChart1.Axes.DepthTop.Title.Shadow.Visible = false;

this.tChart1.Axes.Left.Automatic = true;

this.tChart1.Axes.Left.Grid.ZPosition = 0;

this.tChart1.Axes.Left.Labels.Font.Shadow.Visible = false;

this.tChart1.Axes.Left.Labels.Shadow.Visible = false;

this.tChart1.Axes.Left.Title.Font.Shadow.Visible = false;

this.tChart1.Axes.Left.Title.Shadow.Visible = false;

this.tChart1.Axes.Right.Automatic = true;

this.tChart1.Axes.Right.Grid.ZPosition = 0;

this.tChart1.Axes.Right.Labels.Font.Shadow.Visible = false;

this.tChart1.Axes.Right.Labels.Shadow.Visible = false;

this.tChart1.Axes.Right.Title.Font.Shadow.Visible = false;

this.tChart1.Axes.Right.Title.Shadow.Visible = false;

this.tChart1.Axes.Top.Automatic = true;

this.tChart1.Axes.Top.Grid.ZPosition = 0;

this.tChart1.Axes.Top.Labels.Font.Shadow.Visible = false;

this.tChart1.Axes.Top.Labels.Shadow.Visible = false;

this.tChart1.Axes.Top.Title.Font.Shadow.Visible = false;

this.tChart1.Axes.Top.Title.Shadow.Visible = false;

this.tChart1.Cursor = System.Windows.Forms.Cursors.Default;

this.tChart1.Footer.Font.Shadow.Visible = false;

this.tChart1.Footer.Shadow.Visible = false;

//

this.tChart1.Header.Font.Shadow.Visible = false;

this.tChart1.Header.Lines = new string[] {

""};

this.tChart1.Header.Shadow.Visible = false;

this.tChart1.Legend.Font.Shadow.Visible = false;

this.tChart1.Legend.Title.Font.Bold = true;

this.tChart1.Legend.Title.Font.Shadow.Visible = false;

this.tChart1.Legend.Title.Pen.Visible = false;

this.tChart1.Legend.Title.Shadow.Visible = false;

this.tChart1.Location = new System.Drawing.Point(567, 15);

this.tChart1.Name = "tChart1";

this.tChart1.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;

this.tChart1.Panel.ImageBevel.Width = 1;

this.tChart1.Panel.Shadow.Visible = false;

this.tChart1.Series.Add(this.points1);

this.tChart1.Series.Add(this.fastLine2);

this.tChart1.Size = new System.Drawing.Size(483, 230);

this.tChart1.SubFooter.Font.Shadow.Visible = false;

this.tChart1.SubFooter.Shadow.Visible = false;

this.tChart1.SubHeader.Font.Shadow.Visible = false;

this.tChart1.SubHeader.Shadow.Visible = false;

this.tChart1.TabIndex = 0;

this.tChart1.Walls.Back.AutoHide = false;

this.tChart1.Walls.Back.Shadow.Visible = false;

this.tChart1.Walls.Bottom.AutoHide = false;

this.tChart1.Walls.Bottom.Shadow.Visible = false;

this.tChart1.Walls.Left.AutoHide = false;

this.tChart1.Walls.Left.Shadow.Visible = false;

this.tChart1.Walls.Right.AutoHide = false;

this.tChart1.Walls.Right.Shadow.Visible = false;

//

// label5

//

this.label5.AutoSize = true;

this.label5.Location = new System.Drawing.Point(-1, 2);

this.label5.Name = "label5";

this.label5.Size = new System.Drawing.Size(61, 13);

this.label5.TabIndex = 8;

this.label5.Text = "Матриця Х";

//

// label6

//

this.label6.AutoSize = true;

this.label6.Location = new System.Drawing.Point(-1, 249);

this.label6.Name = "label6";

this.label6.Size = new System.Drawing.Size(61, 13);

this.label6.TabIndex = 9;

this.label6.Text = "Матриця S";

//

// pictureBox1

//

this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));

this.pictureBox1.Location = new System.Drawing.Point(817, 116);

this.pictureBox1.Name = "pictureBox1";

this.pictureBox1.Size = new System.Drawing.Size(196, 56);

this.pictureBox1.TabIndex = 10;

this.pictureBox1.TabStop = false;

//

// Form1

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.ClientSize = new System.Drawing.Size(1062, 566);

this.Controls.Add(this.pictureBox1);

this.Controls.Add(this.label6);

this.Controls.Add(this.label5);

this.Controls.Add(this.textBox1);

this.Controls.Add(this.tChart1);

this.Controls.Add(this.dataGrid2);

this.Controls.Add(this.dataGrid1);

this.Controls.Add(this.panel1);

this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

this.MaximizeBox = false;

this.Name = "Form1";

this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text = "Критерiй Байєcа Лаплаcа (матриця фoрмуєтьcя за екcпoненцiальним закoнoм). Курcoва" +

" рoбoта cтудента групи ПЗc-07-1 Кoчеткoва O.М.";

((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();

this.panel1.ResumeLayout(false);

((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();

((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();

this.ResumeLayout(false);

this.PerformLayout();

 

}

#endregion

 

///

/// The main entry point for the application.

///

[STAThread]

static void Main()

{

Application.Run(new Form1());

}

 

private void button1_Click(object sender, System.EventArgs e)

{

bl.lambda = Convert.ToDouble(numericUpDown1.Value);

//bl.delta = Convert.ToDouble(numericUpDown2.Value);

bl.I = Convert.ToInt32(numericUpDown3.Value);

bl.J = Convert.ToInt32(numericUpDown4.Value);

 

bl.Fill();

//MessageBox.Show("swsds");

bl.Find_v();

bl.Find_max_v();

textBox1.Text = bl.calc;

tChart1.Series[0].Clear();

tChart1.Series[1].Clear();

for (int i = 0; i < bl.I; i++)

{

for (int j = 0; j < bl.J; j++)

{

tChart1.Series[0].Add(bl.x[i,j], bl.y[i,j]);

tChart1.Series[1].Add(bl.x[i,j], bl.Find_F(bl.x[i,j]));

}

textBox1.Text += "\r\n";

}

 

 

DataTable dt = new DataTable("X_S");

DataSet ds = new DataSet("X");

DataTable dt1 = new DataTable("S");

for (int i = 1; i <= bl.J; i++)

{

dt.Columns.Add(i.ToString());

dt1.Columns.Add(i.ToString());

}

string[] s = new string[bl.J];

string[] s1 = new string[bl.J];

for (int i = 0; i < bl.I; i++)

{

for (int j = 0; j < bl.J; j++)

{

s[j] = String.Format(bl.format,bl.x[i,j]);

s1[j] = String.Format(bl.format,bl.y[i,j]);

}

dt.Rows.Add(s);

dt1.Rows.Add(s1);

}

ds.Tables.Add(dt);

dataGrid1.DataSource = ds.Tables[0];

dataGrid1.Expand(-1);

dataGrid1.SelectionBackColor = Color.SeaShell;

dataGrid1.SelectionBackColor = Color.Green;

dataGrid1.Select(bl.max_v[0]);

 

ds.Tables.Add(dt1);

dataGrid2.DataSource = ds.Tables[1];

dataGrid2.Expand(-1);

dataGrid2.SelectionBackColor = Color.SeaShell;

dataGrid2.SelectionBackColor = Color.Green;

dataGrid2.Select(bl.max_v[0]);

 

 

}

 

private void numericUpDown1_ValueChanged(object sender, System.EventArgs e)

{

bl.lambda = Convert.ToDouble(numericUpDown1.Value);

}

 

private void numericUpDown2_ValueChanged(object sender, System.EventArgs e)

{

bl.delta = Convert.ToDouble(numericUpDown2.Value);

}

 

private void numericUpDown3_Value