⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmparam.cs

📁 遗传算法求解大学考试时间表问题
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.IO;
using System.Text;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace timetabling
{
	/// <summary>
	/// frmtaparam 的摘要说明。
	/// </summary>
	public class frmparam : System.Windows.Forms.Form
	{
		private System.Windows.Forms.TextBox tnum;
		private System.Windows.Forms.TextBox textBox1;
		private System.Windows.Forms.TextBox rdata;
		private System.Windows.Forms.TextBox cdata;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.TextBox gan;
		private System.Windows.Forms.TextBox san;
		private System.Windows.Forms.TextBox sat;
		private System.Windows.Forms.TextBox gapm;
		private System.Windows.Forms.TextBox gapc;
		private System.Windows.Forms.TextBox ganp;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Label label11;
		private System.Windows.Forms.TextBox saendn;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.TextBox sadownt;
		private System.Windows.Forms.Label label12;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public frmparam(PARAMETER param,enumarith arith)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			param.CourseFile="coursedata.txt";
			param.RoomFile="roomdata.txt";
			param.TimeSolt=20;
			param.cms=20;
			param.sendn=50;
			param.gn=200;
			param.gpc=0.9f;
			param.gpm=0.1f;
			param.gpn=200;
			param.sn=3000;
			param.st=2000;
			param.sdownt=0.99f;
			if(arith==enumarith.HY)
			{
				param.gn=200;
				param.sendn=50;
				param.gpn=50;
				param.sn=200;
				param.st=2000;
				param.sdownt=0.80f;
			}
			this.cdata.Text=param.CourseFile;
			this.rdata.Text=param.RoomFile;			
			this.tnum.Text=param.TimeSolt.ToString();
			this.textBox1.Text=param.cms.ToString();
		    this.gan.Text=param.gn.ToString();
			this.ganp.Text=param.gpn.ToString();
			this.gapc.Text=param.gpc.ToString();
			this.gapm.Text=param.gpm.ToString();
			this.saendn.Text=param.sendn.ToString();
			this.san.Text=param.sn.ToString();
			this.sat.Text=param.st.ToString();
			this.sadownt.Text=param.sdownt.ToString();
			switch(arith)
			{
				case enumarith.GA:
					this.saendn.Enabled=false;
				    this.san.Enabled=false;
					this.sat.Enabled=false;
					this.sadownt.Enabled=false;
					this.gan.Enabled=true;
					this.ganp.Enabled=true;
					this.gapc.Enabled=true;
					this.gapm.Enabled=true;
					break;

				case enumarith.SA:
					this.saendn.Enabled=true;
					this.san.Enabled=true;
					this.sat.Enabled=true;
					this.gan.Enabled=false;
					this.ganp.Enabled=false;
					this.gapc.Enabled=false;
					this.gapm.Enabled=false;							        
					break;

				case enumarith.HY:
					this.saendn.Enabled=true;
					this.san.Enabled=true;
					this.sat.Enabled=true;
					this.sadownt.Enabled=true;
					this.gan.Enabled=true;
					this.ganp.Enabled=true;
					this.gapc.Enabled=true;
					this.gapm.Enabled=true;	
					this.san.Enabled=false;      
					break;
			}
			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.tnum = new System.Windows.Forms.TextBox();
			this.textBox1 = new System.Windows.Forms.TextBox();
			this.gan = new System.Windows.Forms.TextBox();
			this.san = new System.Windows.Forms.TextBox();
			this.rdata = new System.Windows.Forms.TextBox();
			this.cdata = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.button2 = new System.Windows.Forms.Button();
			this.button1 = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.sat = new System.Windows.Forms.TextBox();
			this.label7 = new System.Windows.Forms.Label();
			this.gapm = new System.Windows.Forms.TextBox();
			this.label6 = new System.Windows.Forms.Label();
			this.gapc = new System.Windows.Forms.TextBox();
			this.label9 = new System.Windows.Forms.Label();
			this.ganp = new System.Windows.Forms.TextBox();
			this.label10 = new System.Windows.Forms.Label();
			this.label11 = new System.Windows.Forms.Label();
			this.saendn = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.sadownt = new System.Windows.Forms.TextBox();
			this.label12 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// tnum
			// 
			this.tnum.Location = new System.Drawing.Point(32, 64);
			this.tnum.Name = "tnum";
			this.tnum.Size = new System.Drawing.Size(104, 21);
			this.tnum.TabIndex = 53;
			this.tnum.Text = "20";
			// 
			// textBox1
			// 
			this.textBox1.Location = new System.Drawing.Point(192, 64);
			this.textBox1.Name = "textBox1";
			this.textBox1.Size = new System.Drawing.Size(104, 21);
			this.textBox1.TabIndex = 51;
			this.textBox1.Text = "50";
			// 
			// gan
			// 
			this.gan.Location = new System.Drawing.Point(32, 104);
			this.gan.Name = "gan";
			this.gan.Size = new System.Drawing.Size(104, 21);
			this.gan.TabIndex = 47;
			this.gan.Text = "50";
			// 
			// san
			// 
			this.san.Location = new System.Drawing.Point(192, 104);
			this.san.Name = "san";
			this.san.Size = new System.Drawing.Size(104, 21);
			this.san.TabIndex = 45;
			this.san.Text = "20";
			// 
			// rdata
			// 
			this.rdata.Location = new System.Drawing.Point(192, 24);
			this.rdata.Name = "rdata";
			this.rdata.Size = new System.Drawing.Size(104, 21);
			this.rdata.TabIndex = 43;
			this.rdata.Text = "rdata.txt";
			// 
			// cdata
			// 
			this.cdata.Location = new System.Drawing.Point(32, 24);
			this.cdata.Name = "cdata";
			this.cdata.Size = new System.Drawing.Size(104, 21);
			this.cdata.TabIndex = 39;
			this.cdata.Text = "cdata.txt";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(32, 48);
			this.label5.Name = "label5";
			this.label5.TabIndex = 52;
			this.label5.Text = "时间格数";
			// 
			// label8
			// 
			this.label8.Location = new System.Drawing.Point(192, 48);
			this.label8.Name = "label8";
			this.label8.TabIndex = 50;
			this.label8.Text = "公共考试科目";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(32, 88);
			this.label4.Name = "label4";
			this.label4.TabIndex = 46;
			this.label4.Text = "GA叠代次数";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(192, 0);
			this.label2.Name = "label2";
			this.label2.TabIndex = 42;
			this.label2.Text = "教室数据文件";
			// 
			// button2
			// 
			this.button2.Location = new System.Drawing.Point(312, 216);
			this.button2.Name = "button2";
			this.button2.TabIndex = 41;
			this.button2.Text = "默认";
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(312, 168);
			this.button1.Name = "button1";
			this.button1.TabIndex = 40;
			this.button1.Text = "确定";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(32, 0);
			this.label1.Name = "label1";
			this.label1.TabIndex = 38;
			this.label1.Text = "课程数据文件";
			// 
			// sat
			// 
			this.sat.Location = new System.Drawing.Point(192, 144);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -