public void ChangeCPUCount(int newCount) { //Console.WriteLine("change -->"+newCount); theControlers = new List <controller>(); for (int i = 0; i < newCount; i++) { controller theCPU = new controller(); theCPU.theCPUName = "CPU" + i; theCPU.makeChargeShower(); theCPU.theMainWindow = this; theControlers.Add(theCPU); } //flash window try { flashWindow(); //AllChargeBook.Items.Clear(); showTextForEDF.Text = ""; textForInformation = ""; for (int i = 0; i < theControlers.Count; i++) { theControlers[i].allTimer = 0; } isAValuableCharge = false; //checkIsValuable.IsChecked = false; } catch { Console.WriteLine("初始化未完全,所以不用清理"); } }
public void makeControllerInformation(controller theController) { for (int i = 0; i < theController.chargesBook.Count; i++) { theTaskString += theController.chargesBook[i].geFullInformationWithOutReturn() + "\n"; } theTaskString += "\n"; switch (theController.schedulingMode) { case 0: { theTaskString += "调度算法: EDF"; } break; case 1: { theTaskString += "调度算法: LLF"; } break; case 2: { theTaskString += "调度算法: RM"; } break; } if (theController.isCanRob) { theTaskString += " (可以抢占)"; } else { theTaskString += " (不可抢占)"; } this.taskInformation.Content = theTaskString; }
public charge(charge theCharge, int indexForThisKind, controller theControllerIn)//附加,这个是某一类进程的第几个实例 { this.chargeLength = theCharge.chargeLength; this.circleTime = theCharge.circleTime; this.deadLine = theCharge.deadLine + (indexForThisKind - 1) * CircleTimer;//相对截止时间变成绝对截止时间了 this.timeMax = theCharge.timeMax; this.startTime = theCharge.startTime; this.isValueAble = theCharge.isValueAble; this.name = theCharge.name + "(第" + indexForThisKind + "实例)"; theController = theControllerIn; }
public charge(int chargeLength, int circleTime, int deadLine, int timerMax, int startTime, string name, controller theControllerIn, bool isValueAble = false) { this.chargeLength = chargeLength; this.circleTime = circleTime; this.deadLine = deadLine; this.timeMax = timerMax; this.name = name; this.startTime = startTime; this.isValueAble = isValueAble; theController = theControllerIn; }
public charge(charge theCharge, controller theControllerIn) { this.chargeLength = theCharge.chargeLength; this.circleTime = theCharge.circleTime; this.deadLine = theCharge.deadLine; this.timeMax = theCharge.timeMax; this.name = theCharge.name; this.startTime = theCharge.startTime; this.isValueAble = theCharge.isValueAble; theController = theControllerIn; }