public void HandleLotEndUltratechTitan(CSSLEvent e) { // Get information of Scheduled Lot Array thisLotEndUltratechTitan = UltratechTitanLotEnds[0]; string irdName = (string)thisLotEndUltratechTitan.GetValue(1); int lotQty = (int)thisLotEndUltratechTitan.GetValue(2); // Remove lot from List UltratechTitanLotEnds.Remove(thisLotEndUltratechTitan); // Add Nr. of produced lots to LayerActivity if (LayerActivities.ContainsKey(irdName)) { LayerActivities[irdName] += lotQty; } else { LayerActivities["Other"] += lotQty; } //TotalWafersProducedDay += lotQty; //TotalLotsProducedDay += 1; //TotalLotsProduced += 1; //TotalWafersProduced += lotQty; // Schedule next event on the UltratechTitan if (UltratechTitanLotEnds.Count > 0) { Array nextLotEndUltratechTitan = UltratechTitanLotEnds[0]; double nextLotEndUltratechTitanTime = (double)nextLotEndUltratechTitan.GetValue(3); ScheduleEvent(nextLotEndUltratechTitanTime, HandleLotEndUltratechTitan); } }
public void HandleEndRun(Lot finishedLot, Machine machine) { // Add Nr. of produced lots to LayerActivity if (LayerActivities.ContainsKey(finishedLot.IrdName)) { LayerActivities[finishedLot.IrdName] += finishedLot.LotQty; } else { LayerActivities["Other"] += finishedLot.LotQty; } TotalLotsProduced += 1; TotalWafersProduced += finishedLot.LotQty; // Calculate and add lateness of lot double lateness = (this.StartDate.AddSeconds(GetTime).Subtract(finishedLot.ImprovedDueDate)).TotalDays; TotalSquaredLateness += lateness * lateness; double earliness = Math.Max(0, (finishedLot.ImprovedDueDate.Subtract(this.StartDate.AddSeconds(GetTime))).TotalDays); TotalSquaredEarliness += earliness * earliness; TotalEarliness += earliness; if (earliness != 0) { TotalLotsProducedEarly += 1; } double tardiness = Math.Max(0, (this.StartDate.AddSeconds(GetTime).Subtract(finishedLot.ImprovedDueDate)).TotalDays); TotalSquaredTardiness += tardiness * tardiness; TotalTardiness += tardiness; if (tardiness != 0) { TotalLotsProducedTardy += 1; } double fractionInSchedulingHorizon = Math.Min(Math.Max(((SchedulingHorizon - machine.CurrentStartRun) / (machine.CurrentEndRun - machine.CurrentStartRun)), 0.0), 1.0); if (!Dynamic) { double theoreticalProductionTime = GetTheoreticalProductionTime(finishedLot); double weightDueDate = finishedLot.WeightDueDate; double weightWIPBalance = finishedLot.WeightWIPBalance; TotalScoreThroughput += fractionInSchedulingHorizon * theoreticalProductionTime / (Machines.Count * SchedulingHorizon); TotalScoreDueDate += fractionInSchedulingHorizon * weightDueDate * (finishedLot.LotQty / 25.0); TotalScoreWIPBalance += fractionInSchedulingHorizon * weightWIPBalance * (finishedLot.LotQty / 25.0); TotalTheoreticalProductionTime += fractionInSchedulingHorizon * theoreticalProductionTime; TotalProductionTime += fractionInSchedulingHorizon * (machine.CurrentEndRun - machine.CurrentStartRun); } else { double theoreticalProductionTime = GetTheoreticalProductionTime(finishedLot); //double weightDueDate = finishedLot.WeightDueDate; //double weightWIPBalance = finishedLot.WeightWIPBalance; TotalScoreThroughput += theoreticalProductionTime / (Machines.Count * LengthOfReplication); //TotalScoreDueDate += fractionInSchedulingHorizon * weightDueDate * (finishedLot.LotQty / 25.0); //TotalScoreWIPBalance += fractionInSchedulingHorizon * weightWIPBalance * (finishedLot.LotQty / 25.0); TotalTheoreticalProductionTime += theoreticalProductionTime; TotalProductionTime += machine.CurrentEndRun - machine.CurrentStartRun; } }