Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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}");
        }
Ejemplo n.º 3
0
        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}");
            }
            ;
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        protected override void OnInitialized(ModelElementBase modelElement)
        {
            WorkCenter workCenter = (WorkCenter)modelElement;

            //headerToConsole(workCenter);
            headerToFile(workCenter);
        }
Ejemplo n.º 6
0
        protected override void OnUpdate(ModelElementBase modelElement)
        {
            WorkStation workStation = (WorkStation)modelElement;

            queueLength.UpdateValue(workStation.Queue.Count);
            queueLengthStatistic.Collect(queueLength.PreviousValue, queueLength.Weight);
        }
Ejemplo n.º 7
0
        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}");
            }
        }
Ejemplo n.º 8
0
 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>();
 }
Ejemplo n.º 9
0
        protected override void OnReplicationEnd(ModelElementBase modelElement)
        {
            ToyFab toyFab = (ToyFab)modelElement;

            replicationReward += toyFab.Reward.GetFinalReward();
            Reward.Collect(replicationReward);
        }
Ejemplo n.º 10
0
        public LotGenerator(ModelElementBase parent, string name, int wipLevel) : base(parent, name)
        {
            toyFab = (ToyFab)parent;

            TargetWIP = wipLevel;

            rnd = new Random();
        }
Ejemplo n.º 11
0
        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");
        }
Ejemplo n.º 12
0
        protected override void OnInitialized(ModelElementBase modelElement)
        {
            WorkStation workStation = (WorkStation)modelElement;

            queueLength.Reset();
            queueLengthStatistic.Reset();
            queueLength.UpdateValue(workStation.Queue.Count);
        }
Ejemplo n.º 13
0
        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}");
        }
Ejemplo n.º 14
0
        protected override void OnInitialized(ModelElementBase modelElement)
        {
            Writer.Write("Simulation Time\tComputational Time\tQueue Length");

            WorkCenter workCenter = (WorkCenter)modelElement;

            queueLength.UpdateValue(workCenter.TotalQueueLength);
        }
Ejemplo n.º 15
0
 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;
 }
Ejemplo n.º 16
0
        protected sealed override void OnInitialized(ModelElementBase modelElement)
        {
            DataCenter dataCenter = (DataCenter)modelElement;

            totalJobCount = dataCenter.Dispatcher.TotalNrJobsInSystem;

            Writer.WriteLine($"Simulation Time,Wall Clock Time,Job Count");
        }
Ejemplo n.º 17
0
        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()}");
        }
Ejemplo n.º 18
0
        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}");
        }
Ejemplo n.º 19
0
        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}");
        }
Ejemplo n.º 20
0
 public Dispatcher(
     ModelElementBase parent,
     string name,
     RLLayerBase reinforcementLearningLayer,
     ServerPool serverPool) : base(parent, name, reinforcementLearningLayer)
 {
     this.serverPool = serverPool;
     state           = new double[2];
 }
Ejemplo n.º 21
0
        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);
        }
Ejemplo n.º 22
0
        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}");
        }
Ejemplo n.º 23
0
        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}");
        }
Ejemplo n.º 24
0
 public CustomerGenerator(
     ModelElementBase parent,
     string name,
     Distribution interEventTimeDistribution,
     Distribution customerDistribution,
     Dispatcher dispatcher) : base(parent, name, interEventTimeDistribution)
 {
     this.customerDistribution = customerDistribution;
     this.dispatcher           = dispatcher;
 }
Ejemplo n.º 25
0
        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);
        }
Ejemplo n.º 26
0
        protected override void OnReplicationStart(ModelElementBase modelElement)
        {
            if (!repHeaderPrinted)
            {
                replicationCounter++;
                Writer?.WriteLine("Time,CycleTime,LotID,ProductType,EndTime,StartTime");
                repHeaderPrinted = true;
            }

            lotCounter = 0;
        }
Ejemplo n.º 27
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;
 }
Ejemplo n.º 28
0
        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();
        }
Ejemplo n.º 29
0
        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();
            }
        }
Ejemplo n.º 30
0
        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"));
            }
        }
Ejemplo n.º 31
0
        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()));
            }
        }