Пример #1
0
        public static void AddWorkStations(ToyFab toyFab, ToyFabSettings toyFabSettings, Simulation sim)
        {
            // Observers
            LotOutObserver LotOutObserver = new LotOutObserver(sim, "LotOutObserver");
            RewardObserver RewardObserver = new RewardObserver(sim, "RewardObserver", Program.WSWithRLDispatcher);

            toyFab.Subscribe(RewardObserver);

            // Work stations
            foreach (string wc in toyFabSettings.WorkStations)
            {
                WorkStation workStation = new WorkStation(toyFab, $"WorkCenter_{wc}", toyFabSettings.LotStepsPerWorkStation[wc]);
                workStation.DispatcherWarmUp = new FIFODispatcher(workStation, workStation.Name + "_FIFODispatcher");
                workStation.Dispatcher       = new FIFODispatcher(workStation, workStation.Name + "_FIFODispatcher");

                QueueObserver queueObserver = new QueueObserver(sim, $"Queue_{wc}");
                workStation.Subscribe(queueObserver);

                // Machines
                foreach (MachineData m in toyFabSettings.Machines.Where(x => x.WorkStation == wc))
                {
                    Machine machine = new Machine(toyFab, $"{workStation.Name}_Machine{m.Number}", new GammaDistribution(m.MeanServiceTime, Math.Pow(m.COVServiceTime * m.MeanServiceTime, 2)), workStation, m.Number);
                    //Machine machine = new Machine(toyFab, $"{workStation.Name}_Machine{m.Number}", new NonNegativeNormalDistribution(m.MeanServiceTime, m.COVServiceTime * m.MeanServiceTime), workStation, m.Number);
                    //Machine machine = new Machine(toyFab, $"{workStation.Name}_Machine{m.Number}", new ExponentialDistribution(1 / m.MeanServiceTime), workStation, m.Number);
                    machine.Eligibilities = m.Eligibilities;
                    machine.Subscribe(LotOutObserver);
                    workStation.Machines.Add(machine);
                }

                toyFab.AddWorkCenter(workStation.Name, workStation);
            }
        }
Пример #2
0
        protected override void OnReplicationEnd(ModelElementBase modelElement)
        {
            ToyFab toyFab = (ToyFab)modelElement;

            replicationReward += toyFab.Reward.GetFinalReward();
            Reward.Collect(replicationReward);
        }
Пример #3
0
        public static void RunNormalSimulation()
        {
            string inputDir  = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\", "Parameters", ParametersDirectory));
            string outputDir = @"C:\CSSLWaferFab\Output\RLToyFab\";

            CSSL.Modeling.Settings.WriteOutput = true;

            // Fab settings
            //IDataReader reader = new DataReader1(inputDir);
            IDataReader    reader         = new DataReader2(inputDir);
            ToyFabSettings toyFabSettings = reader.ReadToyFabSettings();

            // Build Fab
            Simulation sim = new Simulation("RLToyFab", outputDir);

            // Experiment settings
            sim.MyExperiment.NumberOfReplications = 10;
            sim.MyExperiment.LengthOfWarmUp       = LengthOfWarmUp;
            sim.MyExperiment.LengthOfReplication  = LengthOfReplication;

            // Build the model
            ToyFab toyFab = new ToyFab(sim.MyModel, "WaferFab")
            {
                LotSteps       = toyFabSettings.LotSteps,
                LengthOfWarmUp = LengthOfWarmUp
            };

            AddWorkStations(toyFab, toyFabSettings, sim);

            foreach (var sequence in toyFabSettings.Sequences)
            {
                toyFab.AddSequence(sequence.Key, sequence.Value);
            }

            toyFab.SetLotGenerator(new LotGenerator(toyFab, "LotGenerator", NumberOfLots));

            sim.Run();

            // Report summary
            SimulationReporter reporter = sim.MakeSimulationReporter();

            reporter.PrintSummaryToFile();
            reporter.PrintSummaryToConsole();
        }
Пример #4
0
 public RewardODDScaled(ToyFab toyFab) : base(toyFab, "RewardODDScaled")
 {
     this.toyFab = toyFab;
 }
Пример #5
0
 public RewardThroughputTardiness(ToyFab toyFab, double weight = 1) : base(toyFab, "RewardThroughputTardiness")
 {
     this.toyFab  = toyFab;
     DepartedLots = new List <Lot>();
     Weight       = weight;
 }
Пример #6
0
        protected override void OnInitialized(ModelElementBase modelElement)
        {
            ToyFab toyFab = (ToyFab)modelElement;

            toyFab.Reward.Initialize();
        }
Пример #7
0
        protected override void OnUpdate(ModelElementBase modelElement)
        {
            ToyFab toyFab = (ToyFab)modelElement;

            replicationReward += toyFab.Reward.GetReward();
        }
Пример #8
0
 public RewardODD(ToyFab toyFab) : base(toyFab, "RewardODD")
 {
     this.toyFab = toyFab;
 }
Пример #9
0
 public StateDeductedActionSpace(ToyFab toyFab, int JobCountInAction)
 {
     this.toyFab           = toyFab;
     FullState             = new double[7][];
     this.JobCountInAction = JobCountInAction;
 }
Пример #10
0
 public RewardThroughput(ToyFab toyFab, int weight = 1) : base(toyFab, "RewardThroughput")
 {
     this.toyFab  = toyFab;
     DepartedLots = new List <Lot>();
     Weight       = weight;
 }
Пример #11
0
 public RewardODDScaledSingle(ToyFab toyFab) : base(toyFab, "RewardODDScaledSingle")
 {
     this.toyFab = toyFab;
 }
Пример #12
0
 public State(ToyFab toyFab)
 {
     this.toyFab = toyFab;
     FullState   = new double[6][];
 }