public SimulationSnapshot(int replication, string headerLine, string dataLine) { var header = headerLine.Trim(',').Split(','); var data = dataLine.Trim(',').Split(','); if (header.Length != data.Length) { throw new Exception("Snapshot data is incomplete. Number of LotSteps does not match number of WIP levels."); } else { Replication = replication; LotSteps = header.Skip(2).ToArray(); SimulationTime = Convert.ToDouble(data[0]); WallClockTime = Convert.ToDouble(data[1]); int[] WIPlevelsArray = data.Skip(2).Select(x => int.Parse(x)).ToArray(); for (int i = 0; i < LotSteps.Length; i++) { WIPlevels.Add(LotSteps[i], WIPlevelsArray[i]); } } }
public RealSnapshot(DateTime time, List <RealLot> lots, int waferQtyThreshold) { RealLots = lots; LotSteps = lots.Where(x => x.IRDGroup != null).Select(x => x.IRDGroup).Distinct().ToArray(); Time = time; foreach (var lotStep in LotSteps) { WIPlevels.Add(lotStep, lots.Where(x => x.IRDGroup == lotStep).Where(x => x.Qty >= waferQtyThreshold).Count()); WIPlevelsInWafers.Add(lotStep, lots.Where(x => x.IRDGroup == lotStep).Where(x => x.Qty >= waferQtyThreshold).Sum(x => x.Qty)); } }