25801tb等于多少g2000 (255)(805) (255)(805)有什么发现

格瓦斯 皮床 真皮床 双人床软床现代简约皮艺床1.5 1.8米婚床 805
标准床/卡其色
与行业相比
该商品已下柜,欢迎挑选其他商品!
加载中,请稍候...
价 格: 到
   
本店好评商品
商品名称:格瓦斯 皮床 真皮床 双人床软床现代简约皮艺床1.5 1.8米婚床 805
标准床/卡其色
商品编号:
商品毛重:50.0kg
货号:805 床
适用床垫尺寸:180cm*200cm
床架结构:排骨架
风格:现代简约
发货地:佛山
家装风格:简约现代
实木材质:其它
分类:皮床
功能特点:带软靠
商品介绍加载中...
权利声明:京东上的所有商品信息、客户评价、商品咨询、网友讨论等内容,是京东重要的经营资源,未经许可,禁止非法转载使用。
注:本站商品信息均来自于合作方,其真实性、准确性和合法性由信息拥有者(合作方)负责。本站不提供任何保证,并不承担任何法律责任。
价格说明:
京东价:京东价为商品的销售价,是您最终决定是否购买商品的依据。
划线价:商品展示的划横线价格为参考价,该价格可能是品牌专柜标价、商品吊牌价或由品牌供应商提供的正品零售价(如厂商指导价、建议零售价等)或该商品在京东平台上曾经展示过的销售价;由于地区、时间的差异性和市场行情波动,品牌专柜标价、商品吊牌价等可能会与您购物时展示的不一致,该价格仅供您参考。
折扣:如无特殊说明,折扣指销售商在原价、或划线价(如品牌专柜标价、商品吊牌价、厂商指导价、厂商建议零售价)等某一价格基础上计算出的优惠比例或优惠金额;如有疑问,您可在购买前联系销售商进行咨询。
异常问题:商品促销信息以商品详情页“促销”栏中的信息为准;商品的具体售价以订单结算页价格为准;如您发现活动商品售价或促销信息有异常,建议购买前先联系销售商咨询。
iframe(src='///ns.html?id=GTM-T947SH', height='0', width='0', style='display: visibility:')&&&具体原理已在已经介绍过了。下面是实现过程&&&&&&&&&& (Cooling Schedule)tttLSTemperatureDiminishedRateMarkovLengthAIM
Temperature300DiminishedRate0.9
MarkovLength130000AIM100
&&&&&&& 1 T()So() TL
2& whiletrue
21k=1L211215
& 211 distinct
&&&&& 212 if(distinct&0||random(0..1)&exp(distinct/temperature))S
currentPath & bestPath
bestPathcurrentPath
&&&&& 215& Diminish_T_numaim122
&&& 23 currentPath
3 ----------------------------------------------
12…144,10
²Temperature
DiminishedRate0.9 MarkovLength130000 AIM100& &Diminish_ T _num20000
&300300400&40030030159.07
²DiminishedRate
Temperature300 &MarkovLength130000& AIM100& &Diminish_ T _num20000
0.9&0.70.95
²MarkovLength
Temperature300 &DiminishedRate0.9 &AIM100& Diminish_ T _num20000
MarkovLength15000030300
²Diminish_ T _num
MarkovLength130000 Temperature300& DiminishedRate0.9& AIM100&
Diminish_ T _num&20000&20000
-----------------------------------------------代码如下:
/// &summary&
/// &/summary&
public class SAA
public static double[,] city = {
private static int cityNum = 144;& // City total number
private double Temperature = 300;&&& // Initial temperature
private double DiminishedRate = 0.9;& // Temperature diminish rate
private int MarkovLength = 100000;& // Markov Length
private int Diminish_T_num = 20000;& //Used to control the temperature diminishing
private int AIM = 100;& // The condition for stopping search&&
private string pathStr = "";& // Get the best path
private ArrayList currentPath = new ArrayList(); // Record the current path
public ArrayList bestPath = new ArrayList();// Record the best path
public SAA()
//Initialize the initial path 0,1,........,144
public void InitialPath()
for(int i=0;i&cityNi++)
&&&&&& currentPath.Add(i);
//Generate new state from current state .
private void GenerateNext(ArrayList path,int x,int y)
int xCity =
int yCity =
//turn between xCity and yCity
if(xCity & yCity )
path.Reverse(x,y-x+1);
//turn the beginning and the end
else if(xCity & yCity )
path.Reverse(0,y+1);
path.Reverse(x,path.Count-x);
//begin the simulate anneal arithmetic
public string Anneal()
double temperature = T
double distinction = 0;
double currentDst = 0 ; // current total length
double bestDst = 0; // current best total length&&&&&&&
currentDst = CalculateTotalDistance(currentPath);
SetNewState(bestPath,currentPath);
&&& bestDst = currentD
int aim = 0 ;
int diminish_t_num = 0;
Random r = new Random();
while(true)
currentDst = bestD
SetNewState(currentPath,bestPath);
//Current some temperature's Markov loop
for(int i=0;i&MarkovLi++)
{&&&&&&&&&&&&&&&&
int x = 0 , y = 0;
// Select two& random cities
while(x==y)
x = r.Next(cityNum);
y = r.Next(cityNum);
}&&&&&&&&&&&&&&&&
distinction = CalculateDistinct(x,y);&
//if current is better , generate the next new path
if( distinction&0 )
GenerateNext(currentPath,x,y);
currentDst = CalculateTotalDistance(currentPath);
diminish_t_num=0 ;&&
&* else , according the random rate to generate the new path
else if(Math.Exp(0-distinction/temperature) & r.NextDouble())
diminish_t_num++ ;
GenerateNext(currentPath,x,y);
currentDst = CalculateTotalDistance(currentPath);
&&&&&&&&&& }
{&&&&&&&&&&&&&&&&&&&&&&&&&&
diminish_t_num++ ;
/*if the current length is better , reset the best length with current length.
&* and replace the best path with the current path
if(currentDst&bestDst)
bestDst = currentD
SetNewState(bestPath,currentPath);
/*Aim is used to control the markvo loop
&* if the markvo link loops AIM times without
&* generating the new best path,then it will stop
&* the anneal and return the current best path.
if(aim==AIM)
for(int j=0;j&bestPath.Cj++)
pathStr += bestPath[j]+"--&";
pathStr += "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Min Length = " + CalculateTotalDistance(bestPath);
return pathS
/*At the same temperature,if the markvo looping Diminish_T_num times
&*generating the new best path,it will drop out of the loop and begin next annealing.
if(diminish_t_num&Diminish_T_num)
temperature *= DiminishedR//deminish the temperature
//Calculate the path's total length
private double CalculateTotalDistance(ArrayList path)
double total = 0;
for(int i=0;i&cityNum-1;i++)
total += city[(int)path[i],(int)path[i+1]] ;
total += city[(int)path[cityNum-1],(int)path[0]];
//calculate the distinct length betweent current path and the new path
private double CalculateDistinct(int x, int y)
int x1,x2,y1,y2;
double distinct = 0;
x1 = x - 1;
x2 = x + 1;
y1 = y - 1;
y2 = y + 1;
//To deal with the begging and end special codition .
if(y==cityNum-1)
y1 = cityNum - 1;
if(x==cityNum-1)
x1 = cityNum - 1;
distinct = city[(int)currentPath[x1],(int)currentPath[y]]+city[(int)currentPath[x],(int)currentPath[y2]]-
&&& city[(int)currentPath[x1],(int)currentPath[x]]-city[(int)currentPath[y],(int)currentPath[y2]];
distinct = -(city[(int)currentPath[y],(int)currentPath[y2]]+city[(int)currentPath[x1],(int)currentPath[x]]+city[(int)currentPath[cityNum - 1],(int)currentPath[0]]-
&&& city[(int)currentPath[0],(int)currentPath[y2]]-city[(int)currentPath[x1],(int)currentPath[cityNum - 1]]-city[(int)currentPath[x],(int)currentPath[y]]);
private void SetNewState(ArrayList currentP,ArrayList newP)
&&& currentP.Clear();
for(int j=0;j&newP.Cj++)
currentP.Add(newP[j]) ;
public void SetStartTemperature(int t)
Temperature =
public void SetMarkovLength(int t)
MarkovLength =
public void SetDiminishedRate(double t)
DiminishedRate =
public void SetDiminish_T_num(int t)
Diminish_T_num =
public void SetAIM(int t)
#endregion
&------------------
/// &summary&
/// &/summary&
public class Form1 : System.Windows.Forms.Form
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem7;
private System.Windows.Forms.MenuItem menuItem8;
private System.Windows.Forms.MenuItem menuItem9;
private System.Windows.Forms.MenuItem menuItem10;
private System.Windows.Forms.MenuItem menuItem12;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label A
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Button button2;
private SAA saa = new SAA();
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage TSP_SAA;
private System.Windows.Forms.TabPage CITY_MAP;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button button4;
private int[,] city = new int[144,2];
/// &summary&
/// &/summary&
private ponentModel.Container components = null;
public Form1()
// Windows
InitializeComponent();
// TODO: 调用后添加任何构造函数代码
/// &summary&
/// &/summary&
protected override void Dispose( bool disposing )
if( disposing )
&&& if (components != null)
components.Dispose();
base.Dispose( disposing );
/// &summary&
/// 不要使用代码编辑器修改
/// &/summary&
private void InitializeComponent()
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.menuItem7 = new System.Windows.Forms.MenuItem();
this.menuItem8 = new System.Windows.Forms.MenuItem();
this.menuItem9 = new System.Windows.Forms.MenuItem();
this.menuItem10 = new System.Windows.Forms.MenuItem();
&&&&&& this.menuItem12 = new System.Windows.Forms.MenuItem();
this.panel1 = new System.Windows.Forms.Panel();
this.button3 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox5 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.Author = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.TSP_SAA = new System.Windows.Forms.TabPage();
this.CITY_MAP = new System.Windows.Forms.TabPage();
this.label10 = new System.Windows.Forms.Label();
this.button5 = new System.Windows.Forms.Button();
this.panel3 = new System.Windows.Forms.Panel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.button4 = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.tabControl1.SuspendLayout();
this.TSP_SAA.SuspendLayout();
this.CITY_MAP.SuspendLayout();
this.panel3.SuspendLayout();
this.SuspendLayout();
// mainMenu1
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
& this.menuItem1,
& this.menuItem6,
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & this.menuItem10,
& this.menuItem12});
// menuItem1
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
& this.menuItem2,
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & this.menuItem4});
this.menuItem1.Text = "Operation";
// menuItem2
this.menuItem2.Index = 0;
this.menuItem2.Text = "Start";
// menuItem4
this.menuItem4.Index = 1;
this.menuItem4.Text = "Exit";
this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
// menuItem6
this.menuItem6.Index = 1;
this.menuItem6.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
& this.menuItem7,
& this.menuItem8,
& this.menuItem9});
this.menuItem6.RadioCheck = true;
this.menuItem6.Text = "Arithmetic";
// menuItem7
this.menuItem7.Index = 0;
this.menuItem7.RadioCheck = true;
this.menuItem7.Text = "Depth-First";
// menuItem8
this.menuItem8.Index = 1;
this.menuItem8.Text = "Width_First";
// menuItem9
this.menuItem9.Index = 2;
this.menuItem9.Text = "Depth_Width";
// menuItem10
this.menuItem10.Index = 2;
this.menuItem10.Text = "Help";
// menuItem12
this.menuItem12.Index = 3;
this.menuItem12.Text = "About";
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedS
this.panel1.Controls.Add(this.button3);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.textBox5);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.textBox4);
this.panel1.Controls.Add(this.textBox3);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.textBox2);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.textBox1);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.button1);
this.panel1.Location = new System.Drawing.Point(16, 24);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(456, 104);
this.panel1.TabIndex = 8;
// button3
this.button3.Location = new System.Drawing.Point(376, 72);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(48, 23);
this.button3.TabIndex = 12;
this.button3.Text = "Save";
this.button3.Click += new System.EventHandler(this.button3_Click);
// button2
this.button2.Location = new System.Drawing.Point(312, 72);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(48, 23);
this.button2.TabIndex = 11;
this.button2.Text = "Clear";
this.button2.Click += new System.EventHandler(this.button2_Click);
// textBox5
this.textBox5.Location = new System.Drawing.Point(104, 72);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(64, 21);
this.textBox5.TabIndex = 10;
this.textBox5.Text = "100";
this.label5.Location = new System.Drawing.Point(16, 72);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 23);
this.label5.TabIndex = 9;
this.label5.Text = "Aim Num";
// textBox4
this.textBox4.Location = new System.Drawing.Point(352, 40);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(72, 21);
this.textBox4.TabIndex = 8;
this.textBox4.Text = "20000";
// textBox3
this.textBox3.Location = new System.Drawing.Point(352, 8);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(72, 21);
this.textBox3.TabIndex = 7;
this.textBox3.Text = "0.9";
this.label4.Location = new System.Drawing.Point(248, 40);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(96, 23);
this.label4.TabIndex = 6;
this.label4.Text = "Diminish_T_num";
this.label3.Location = new System.Drawing.Point(248, 8);
&&& this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(96, 23);
this.label3.TabIndex = 5;
this.label3.Text = "DiminishedRate";
// textBox2
this.textBox2.Location = new System.Drawing.Point(104, 40);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(64, 21);
this.textBox2.TabIndex = 4;
this.textBox2.Text = "130000";
this.label2.Location = new System.Drawing.Point(16, 40);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(88, 23);
this.label2.TabIndex = 3;
this.label2.Text = "Markov Length";
// textBox1
this.textBox1.Location = new System.Drawing.Point(104, 8);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(64, 21);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "300";
this.label1.Location = new System.Drawing.Point(16, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 23);
this.label1.TabIndex = 2;
this.label1.Text = "Temperature";
// button1
this.button1.Location = new System.Drawing.Point(248, 72);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(48, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Start";
this.button1.Click += new System.EventHandler(this.button1_Click);
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedS
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.label6);
this.panel2.Controls.Add(this.Author);
this.panel2.Location = new System.Drawing.Point(520, 24);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(128, 104);
this.panel2.TabIndex = 7;
this.label7.Location = new System.Drawing.Point(16, 72);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(104, 23);
&&& this.label7.TabIndex = 2;
this.label7.Text = "Softeware School";
this.label6.Location = new System.Drawing.Point(16, 40);
this.label6.Name = "label6";
this.label6.TabIndex = 1;
this.label6.Text = "";
this.Author.Location = new System.Drawing.Point(16, 16);
this.Author.Name = "Author";
this.Author.Size = new System.Drawing.Size(100, 24);
this.Author.TabIndex = 0;
this.Author.Text = "";
// richTextBox1
this.richTextBox1.Location = new System.Drawing.Point(16, 144);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(632, 344);
this.richTextBox1.TabIndex = 6;
this.richTextBox1.Text = "";
&&&&&& // label8
this.label8.Location = new System.Drawing.Point(8, 496);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(72, 23);
this.label8.TabIndex = 9;
this.label8.Text = "Time Elapse";
this.label9.ForeColor = System.Drawing.Color.B
this.label9.Location = new System.Drawing.Point(96, 496);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(160, 23);
this.label9.TabIndex = 10;
// tabControl1
this.tabControl1.AllowDrop = true;
this.tabControl1.Controls.Add(this.TSP_SAA);
this.tabControl1.Controls.Add(this.CITY_MAP);
this.tabControl1.Location = new System.Drawing.Point(8, 8);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(672, 544);
this.tabControl1.TabIndex = 11;
// TSP_SAA
this.TSP_SAA.Controls.Add(this.panel1);
this.TSP_SAA.Controls.Add(this.panel2);
this.TSP_SAA.Controls.Add(this.richTextBox1);
this.TSP_SAA.Controls.Add(this.label8);
this.TSP_SAA.Controls.Add(this.label9);
this.TSP_SAA.Location = new System.Drawing.Point(4, 21);
this.TSP_SAA.Name = "TSP_SAA";
this.TSP_SAA.Size = new System.Drawing.Size(664, 519);
this.TSP_SAA.TabIndex = 0;
this.TSP_SAA.Text = "TSP SAA";
// CITY_MAP
this.CITY_MAP.Controls.Add(this.label10);
this.CITY_MAP.Controls.Add(this.button4);
this.CITY_MAP.Controls.Add(this.button5);
this.CITY_MAP.Controls.Add(this.panel3);
this.CITY_MAP.Location = new System.Drawing.Point(4, 21);
this.CITY_MAP.Name = "CITY_MAP";
this.CITY_MAP.Size = new System.Drawing.Size(664, 519);
this.CITY_MAP.TabIndex = 1;
this.CITY_MAP.Text = "City Map";
// label10
this.label10.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(0)), ((System.Byte)(0)));
this.label10.Location = new System.Drawing.Point(168, 32);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(256, 16);
this.label10.TabIndex = 7;
this.label10.Text = "Pls draw cities first !";
// button5
this.button5.Enabled = false;
this.button5.Location = new System.Drawing.Point(472, 24);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(124, 23);
this.button5.TabIndex = 5;
this.button5.Text = "Draw Shortest Path";
this.button5.Click += new System.EventHandler(this.button5_Click);
this.panel3.Controls.Add(this.pictureBox1);
this.panel3.Location = new System.Drawing.Point(52, 55);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(560, 448);
this.panel3.TabIndex = 4;
// pictureBox1
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedS
this.pictureBox1.Location = new System.Drawing.Point(16, 16);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(528, 416);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
// button4
this.button4.Location = new System.Drawing.Point(64, 24);
this.button4.Name = "button4";
this.button4.TabIndex = 6;
this.button4.Text = "Draw City";
this.button4.Click += new System.EventHandler(this.button4_Click);
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(688, 561);
this.Controls.Add(this.tabControl1);
this.Menu = this.mainMenu1;
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.TSP_SAA.ResumeLayout(false);
this.CITY_MAP.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.ResumeLayout(false);
#endregion
/// &summary&
/// &/summary&
[STAThread]
static void Main()
Application.Run(new Form1());
private void Form1_Load(object sender, System.EventArgs e)
private void button1_Click(object sender, System.EventArgs e)
saa = new SAA();
saa.InitialPath();
saa.SetStartTemperature(Int32.Parse(textBox1.Text));
saa.SetMarkovLength(Int32.Parse(textBox2.Text));
saa.SetDiminishedRate(Double.Parse(textBox3.Text));
saa.SetDiminish_T_num(Int32.Parse(textBox4.Text));
saa.SetAIM(Int32.Parse(textBox5.Text));
DateTime start = DateTime.N
string path = saa.Anneal();
label9.Text = "" + (DateTime.Now-start);
richTextBox1.Text += "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "+
"-----------------------------------------------------------------------------------------------"+
"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& "+
button5.Enabled = true;
private void button2_Click(object sender, System.EventArgs e)
richTextBox1.Text = "";
private void button3_Click(object sender, System.EventArgs e)
FileStream file = File.Open("Result.txt",System.IO.FileMode.Create);
StreamWriter w = new StreamWriter(file);
w.Write(richTextBox1.Text);
w.Flush();
w.Close();
file.Close();
private void button4_Click(object sender, System.EventArgs e)
draw = new Thread(new ThreadStart(DrawCityMap));
draw.Start();&&&&&&&
private void DrawCityMap()
ReadData();
drawer = pictureBox1.CreateGraphics();
for(int i=0;i&143;i++)
x = city[i,0]/10;
y = city[i,1]/10;
drawer.DrawPie(Pens.Blue,x-2,y-2,4,4,0,360);
Thread.Sleep(10);
label10.Text = "Finish drawing city map !";
private void DrawShortestPath()
Point p1 , p2 ;
ArrayList bestPath = saa.bestP
if(bestPath==null)
int pos1,pos2;
drawer = pictureBox1.CreateGraphics();
for(int i=0;i&143;i++)
pos1 = Int32.Parse(bestPath[i].ToString());
pos2 = Int32.Parse(bestPath[i+1].ToString());
p1 = new Point(city[pos1,0]/10,city[pos1,1]/10);
p2 = new Point(city[pos2,0]/10,city[pos2,1]/10);
drawer.DrawLine(Pens.Red,p1,p2);
Thread.Sleep(200);
pos1 = Int32.Parse(bestPath[143].ToString());
pos2 = Int32.Parse(bestPath[0].ToString());
p1 = new Point(city[pos1,0]/10,city[pos1,1]/10);
p2 = new Point(city[pos2,0]/10,city[pos2,1]/10);
drawer.DrawLine(Pens.Purple,p1,p2);
label1.Text = "Finish drawing the shortest path !";
private void button5_Click(object sender, System.EventArgs e)
draw = new Thread(new ThreadStart(DrawShortestPath));
draw.Start(); &&&&&&
private void ReadData()
FileStream file = File.Open("city.txt",System.IO.FileMode.Open);
StreamReader r = new StreamReader(file);
string temp = r.ReadLine();
int i = 0;
int startP = 0;
int length = 0;
while(i!=144)
startP = 0;
length = 0;
startP = temp.IndexOf("x=");
length = temp.IndexOf(";")-startP-2;
city[i,0] = Int32.Parse(temp.Substring(startP+2,length));
startP = temp.IndexOf("y=");
length = temp.IndexOf(";",startP)-startP-2;
city[i,1] = Int32.Parse(temp.Substring(startP+2,length));
temp = r.ReadLine();
r.Close();
file.Close();
private void menuItem4_Click(object sender, System.EventArgs e)
Application.Exit();
本文已收录于以下专栏:
相关文章推荐
1、模拟退火算法简介
模拟退火算法(Simulated Annealing,SA)最早的思想是由N. Metropolis等人于1953年提出。1983
年,S. Kirkpatrick 等成功...
模拟退火算法模拟退火算法(Simulated Annealing)求解工作指派问题(Assignment Problem)的Python实现1 简单指派问题nn个工作可以由nn个工人分别完成。工人ii...
旅行商问题,即TSP问题(Travelling Salesman Problem)又译为旅行推销员问题、货郎担问题,是数学领域中著名问题之一。假设有一个旅行商人要拜访n个城市,他必须选择所要走的路径,...
一、TSP问题
TSP问题(Travelling Salesman Problem)即旅行商问题,又译为旅行推销员问题、货郎担问题,是数学领域中著名问题之一。假设有一个旅行商人要拜访n个城市,他...
temperature=100*n;
iter=20...
一. 爬山算法 ( Hill Climbing )
         介绍模拟退火前,先介绍爬山算法。爬山算法是一种简单的贪心搜索算法,该算法每次从当前解的临近解空间中选择一个最优解作为当前解,...
他的最新文章
讲师:韦玮
讲师:陈守元
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)

我要回帖

更多关于 805brl 等于多少cny 的文章

 

随机推荐