public override void OnNext(object info) { ModelElementBase modelElement = (ModelElementBase)info; switch (modelElement.ObserverState) { case ModelElementObserverState.BEFORE_EXPERIMENT: OnExperimentStart(modelElement); break; case ModelElementObserverState.BEFORE_REPLICATION: OnReplicationStart(modelElement); break; case ModelElementObserverState.WARMUP: OnWarmUp(modelElement); break; case ModelElementObserverState.INITIALIZED: OnInitialized(modelElement); break; case ModelElementObserverState.UPDATE: OnUpdate(modelElement); break; case ModelElementObserverState.AFTER_REPLICATION: OnReplicationEnd(modelElement); break; case ModelElementObserverState.AFTER_EXPERIMENT: OnExperimentEnd(modelElement); break; } }
protected override void OnExperimentEnd(ModelElementBase modelElement) { WorkStation ws = (WorkStation)modelElement; ExperimentWriter?.WriteLine($"{ws.Name},{meanQueueLength.Average()},{stdQueueLength.Average()}"); Console.WriteLine($"Queue length mean: {meanQueueLength.Average()} stdev: {stdQueueLength.Average()} - {ws.Name}"); }
protected override void OnUpdate(ModelElementBase modelElement) { // Get machine object Machine machine = (Machine)modelElement; if (machine.EndedOnError) { Writer.WriteLine($"Ended on error, no processing time found for {machine.Name} {machine.CurrentLot.LotID} {machine.CurrentLot.IrdName} {machine.CurrentLot.MasksetLayer_RecipeStepCluster}"); } else { // Get values string lotID = machine.CurrentLot.LotID; string irdName = machine.CurrentLot.IrdName; string reticle = machine.CurrentLot.MasksetLayer; DateTime startRun = startDateRun.AddSeconds(machine.CurrentStartRun); string startRunString = startRun.ToString("yyyy-MM-dd HH:mm:ss"); DateTime endRun = startDateRun.AddSeconds(machine.CurrentEndRun); string endRunString = endRun.ToString("yyyy-MM-dd HH:mm:ss"); double lateness = Math.Ceiling((machine.CurrentLot.ImprovedDueDate.Subtract(endRun)).TotalDays); string resource = machine.Name; // Write Writer.WriteLine($"{lotID},{startRunString},{endRunString},{resource},{irdName},{reticle},{lateness}"); } ; }
protected override void OnUpdate(ModelElementBase modelElement) { Machine machine = (Machine)modelElement; Lot lot = machine.LotInService; string type = lot.ProductType; //Writer?.WriteLine($"{machine.GetTime},{lot.EndTime - lot.StartTime},{lot.Id},{lot.ProductType},{lot.EndTime},{lot.StartTime}"); ExperimentWriter?.WriteLine($"{replicationCounter},{machine.GetTime},{lot.EndTime - lot.StartTime},{lot.Id},{lot.ProductType},{lot.EndTime},{lot.StartTime},{lot.Lateness}"); lotCounter++; if (!Lateness.ContainsKey(type)) { Lateness.Add(lot.ProductType, new Statistic("Lateness")); Tardiness.Add(lot.ProductType, new Statistic("Lateness")); Earliness.Add(lot.ProductType, new Statistic("Lateness")); } Lateness[type].Collect(lot.Lateness); if (lot.Lateness > 0) { Tardiness[type].Collect(lot.Lateness); } else { Earliness[type].Collect(lot.Lateness); } }
protected override void OnInitialized(ModelElementBase modelElement) { WorkCenter workCenter = (WorkCenter)modelElement; //headerToConsole(workCenter); headerToFile(workCenter); }
protected override void OnUpdate(ModelElementBase modelElement) { WorkStation workStation = (WorkStation)modelElement; queueLength.UpdateValue(workStation.Queue.Count); queueLengthStatistic.Collect(queueLength.PreviousValue, queueLength.Weight); }
protected override void OnExperimentStart(ModelElementBase modelElement) { AssemblyLine assemblyLine = (AssemblyLine)modelElement; bufferContentStatistics = new WeightedStatistic[assemblyLine.Length]; bufferContents = new Variable <double> [assemblyLine.Length]; foreach (Buffer buffer in assemblyLine.Buffers.Skip(1)) { bufferContentStatistics[buffer.Index] = new WeightedStatistic($"{buffer.Name}_content"); bufferContents[buffer.Index] = new Variable <double>(this); } throughPutStatistics = new Statistic[1]; for (int i = 0; i < 1; i++) { throughPutStatistics[i] = new Statistic($"Throughput"); } upStatistics = new Statistic[assemblyLine.Machines.Length]; downStatistics = new Statistic[assemblyLine.Machines.Length]; starvedStatistics = new Statistic[assemblyLine.Machines.Length]; blockedStatistics = new Statistic[assemblyLine.Machines.Length]; foreach (Machine machine in assemblyLine.Machines) { upStatistics[machine.Index] = new Statistic($"UpTime_{machine.Name}"); downStatistics[machine.Index] = new Statistic($"DownTime_{machine.Name}"); starvedStatistics[machine.Index] = new Statistic($"StarvedTime_{machine.Name}"); blockedStatistics[machine.Index] = new Statistic($"BlockedTime_{machine.Name}"); } }
public WaferFab(ModelElementBase parent, string name) : base(parent, name) { WorkCenters = new Dictionary <string, WorkCenter>(); Sequences = new Dictionary <LotType, Sequence>(); LotSteps = new Dictionary <string, LotStep>(); LotStarts = new Dictionary <LotType, int>(); }
protected override void OnReplicationEnd(ModelElementBase modelElement) { ToyFab toyFab = (ToyFab)modelElement; replicationReward += toyFab.Reward.GetFinalReward(); Reward.Collect(replicationReward); }
public LotGenerator(ModelElementBase parent, string name, int wipLevel) : base(parent, name) { toyFab = (ToyFab)parent; TargetWIP = wipLevel; rnd = new Random(); }
protected override void OnInitialized(ModelElementBase modelElement) { ServerPool serverPool = (ServerPool)modelElement; nrOfJobs.UpdateValue(serverPool.JobCount); Writer.WriteLine($"Current Simulation Time,Average number of jobs, StDev on average number of jobs"); }
protected override void OnInitialized(ModelElementBase modelElement) { WorkStation workStation = (WorkStation)modelElement; queueLength.Reset(); queueLengthStatistic.Reset(); queueLength.UpdateValue(workStation.Queue.Count); }
protected override void OnUpdate(ModelElementBase modelElement) { DispatcherBase dispatcher = (DispatcherBase)modelElement; Lot lot = dispatcher.DepartingLot; Writer?.WriteLine($"{dispatcher.GetDateTime},{lot.EndTime - lot.StartTime},{lot.GetCurrentStep.Name},{lot.LotID},{lot.ProductType},{lot.EndTime},{lot.StartTime},{lot.CycleTimeTotalReal},{lot.WIPInReal},{lot.WIPIn}"); }
protected override void OnInitialized(ModelElementBase modelElement) { Writer.Write("Simulation Time\tComputational Time\tQueue Length"); WorkCenter workCenter = (WorkCenter)modelElement; queueLength.UpdateValue(workCenter.TotalQueueLength); }
public Machine(ModelElementBase parent, string name, Distribution serviceTimeDistribution, WorkStation workstation, int index) : base(parent, name) { Eligibilities = new List <LotStep>(); ServiceTimeDistribution = serviceTimeDistribution; WorkStation = workstation; StartTimeCurrentService = -1; Index = index; }
protected sealed override void OnInitialized(ModelElementBase modelElement) { DataCenter dataCenter = (DataCenter)modelElement; totalJobCount = dataCenter.Dispatcher.TotalNrJobsInSystem; Writer.WriteLine($"Simulation Time,Wall Clock Time,Job Count"); }
protected override void OnUpdate(ModelElementBase modelElement) { ServerPool serverPool = (ServerPool)modelElement; nrOfJobs.UpdateValue(serverPool.JobCount); nrOfJobsStatistic.Collect(nrOfJobs.Value, nrOfJobs.Weight); Writer.WriteLine($"{serverPool.GetTime}',{nrOfJobsStatistic.Average()},{nrOfJobsStatistic.StandardDeviation()}"); }
protected override void OnUpdate(ModelElementBase modelElement) { Dispatcher dispatcher = (Dispatcher)modelElement; queueLength.UpdateValue(dispatcher.QueueLength); queueLengthStatistic.Collect(queueLength.Value, queueLength.Weight); Writer?.WriteLine($"{dispatcher.GetTime},{queueLength.Value}"); }
protected sealed override void OnUpdate(ModelElementBase modelElement) { DataCenter dataCenter = (DataCenter)modelElement; totalJobCount = dataCenter.Dispatcher.TotalNrJobsInSystem; Writer.WriteLine($"{dataCenter.GetTime},{dataCenter.GetWallClockTime},{totalJobCount}"); //Console.WriteLine($"{simulationTime}\t{computationalTime}\t{totalJobCount}"); }
public Dispatcher( ModelElementBase parent, string name, RLLayerBase reinforcementLearningLayer, ServerPool serverPool) : base(parent, name, reinforcementLearningLayer) { this.serverPool = serverPool; state = new double[2]; }
protected override void OnUpdate(ModelElementBase modelElement) { WorkCenter workCenter = (WorkCenter)modelElement; queueLength.UpdateValue(workCenter.TotalQueueLength); queueLengthStatistic.Collect(queueLength.PreviousValue, queueLength.Weight); Writer.Write(workCenter.GetTime + "\t" + workCenter.GetWallClockTime + "\t" + queueLength.Value); }
protected override void OnReplicationEnd(ModelElementBase modelElement) { WorkCenter workCenter = (WorkCenter)modelElement; queueLength.UpdateValue(workCenter.TotalQueueLength); QueueLengthStatistic.Collect(queueLength.PreviousValue, queueLength.Weight); Writer?.WriteLine($"{workCenter.GetTime},{queueLength.Value}"); }
protected override void OnInitialized(ModelElementBase modelElement) { Writer?.WriteLine("Simulation Time,Queue Length"); WorkCenter workCenter = (WorkCenter)modelElement; queueLength.UpdateValue(workCenter.InitialLots.Count()); Writer?.WriteLine($"{workCenter.GetTime},{queueLength.Value}"); }
public CustomerGenerator( ModelElementBase parent, string name, Distribution interEventTimeDistribution, Distribution customerDistribution, Dispatcher dispatcher) : base(parent, name, interEventTimeDistribution) { this.customerDistribution = customerDistribution; this.dispatcher = dispatcher; }
protected override void OnUpdate(ModelElementBase modelElement) { WorkCenter workCenter = (WorkCenter)modelElement; LotStep step = workCenter.LastArrivedLot.GetCurrentStep; queueLengths[step].UpdateValue(workCenter.Queues[step].Length); queueLengthsStatistic[step].Collect(queueLengths[step].PreviousValue, queueLengths[step].Weight); writeToFile(workCenter); }
protected override void OnReplicationStart(ModelElementBase modelElement) { if (!repHeaderPrinted) { replicationCounter++; Writer?.WriteLine("Time,CycleTime,LotID,ProductType,EndTime,StartTime"); repHeaderPrinted = true; } lotCounter = 0; }
public Dispatcher(ModelElementBase parent, string name, Distribution serviceTimeDistribution, double serviceTimeThreshold, List <ServerPool> serverPools, double dispatchTime, int nrServerPools) : base(parent, name) { dataCenter = (DataCenter)parent; Queue = new CSSLQueue <Job>(this, name + "_Queue"); this.serviceTimeDistribution = serviceTimeDistribution; this.serviceTimeThreshold = serviceTimeThreshold; rnd = new Random(); this.serverPools = serverPools; this.dispatchTime = dispatchTime; this.nrServerPoolsToChooseFrom = nrServerPools; }
public Machine(ModelElementBase parent, string name, DispatcherBase dispatcher, int seedNumber) : base(parent, name) { // Get lithographyArea object LithographyArea = (LithographyArea)parent; // Get dispatcher object Dispatcher = dispatcher; // Create new queue object Queue = new CSSLQueue <Lot>(this, name + "_Queue"); List <string> RMSTools = new List <string> { "StepCluster#5", "StepCluster#7", "ASML#9" }; if (RMSTools.Contains(name)) { DeterministicNonProductiveTimeDictionary = new Dictionary <string, double> { { "SameReticle", LithographyArea.DeterministicNonProductiveTimesRMS["SameReticle"] }, { "DifferentReticle", LithographyArea.DeterministicNonProductiveTimesRMS["DifferentReticle"] }, { "DifferentIRD", LithographyArea.DeterministicNonProductiveTimesRMS["DifferentIRD"] } }; } else { DeterministicNonProductiveTimeDictionary = new Dictionary <string, double> { { "SameReticle", LithographyArea.DeterministicNonProductiveTimesARMS["SameReticle"] }, { "DifferentReticle", LithographyArea.DeterministicNonProductiveTimesARMS["DifferentReticle"] }, { "DifferentIRD", LithographyArea.DeterministicNonProductiveTimesARMS["DifferentIRD"] } }; } // Create processingTimeDictionary DeterministicProcessingTimeDictionary = LithographyArea.Reader.ReadDeterministicProcessingTimes(Name); if (LithographyArea.Stochastic) { // Create processingTimeDictionary StochasticProcessingTimeDictionary = LithographyArea.Reader.ReadStochasticProcessingTimes(Name); // Create nonProductiveTimeProbabilityDictionary NonProductiveTimeProbabilityDictionary = LithographyArea.Reader.ReadNonProductiveTimeProbabilities(Name); // Create nonProductiveTimeDictionary StochasticNonProductiveTimeDictionary = LithographyArea.Reader.ReadStochasticNonProductiveTimes(Name); } startState = LithographyArea.Reader.ReadRealStartState(Name, LithographyArea.StartDate); SeedNumber = seedNumber; MachineDownRandomNumber = new Random(); }
protected override void OnReplicationStart(ModelElementBase modelElement) { WorkCenter workCenter = (WorkCenter)modelElement; foreach (LotStep step in workCenter.LotSteps) { queueLengths[step].Reset(); // Uncomment below if one want to save across replication statistics queueLengthsStatistic[step].Reset(); } }
public WorkCenter(ModelElementBase parent, string name, Distribution serviceTimeDistribution, List <LotStep> lotSteps) : base(parent, name) { LotSteps = lotSteps; ServiceTimeDistribution = serviceTimeDistribution; LotStepInService = null; foreach (LotStep lotStep in lotSteps) { Queues.Add(lotStep, new CSSLQueue <Lot>(this, name + "_" + lotStep.Name + "_Queue")); } }
private void FillProperties(ModelElementBase ele, System.Data.SqlClient.SqlConnection conn, params string[] prms) { string[] parameters = new string[7]; for( int i=0;i<prms.Length ;i++) { parameters[i] = prms[i]; } DS.SchemaReaderTableAdapters.DBObjPropertiesTableAdapter dbProps = new CodeGenerator.BL.DBReader.DS.SchemaReaderTableAdapters.DBObjPropertiesTableAdapter(); dbProps.Connection = conn; DS.SchemaReader.DBObjPropertiesDataTable dtProps = new CodeGenerator.BL.DBReader.DS.SchemaReader.DBObjPropertiesDataTable(); dbProps.Fill(dtProps, parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6]); foreach (DS.SchemaReader.DBObjPropertiesRow rprop in dtProps.Rows) { ele.Properties.Add(new PropertyPair(rprop.name.ToString(), rprop.value.ToString())); } }