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; }
public override void BuildTrainingEnvironment() { string inputDir = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\", "Parameters", Program.ParametersDirectory)); string outputDir = @"C:\CSSLWaferFab\Output\RLToyFab\"; Simulation = new RLSimulation("RLToyFab", outputDir); // Fab settings //IDataReader reader = new DataReader1(inputDir); IDataReader reader = new DataReader2(inputDir); ToyFabSettings toyFabSettings = reader.ReadToyFabSettings(); // Build the model toyFab = new ToyFab(Simulation.MyModel, "ToyFab", this) { LotSteps = toyFabSettings.LotSteps, }; LotOutObserver LotOutObserver = new LotOutObserver(Simulation, "LotOutObserver"); // 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"); if (wc == Program.WSWithRLDispatcher || Program.WSWithRLDispatcher == "") { workStation.Dispatcher = new RLDispatcherDeductedActionSpace(workStation, workStation.Name + "_RLDispatcher", this, Program.TimePerDispatchTrigger); } else { workStation.Dispatcher = new FIFODispatcher(workStation, workStation.Name + "_FIFODispatcher"); } // 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.Eligibilities = m.Eligibilities; workStation.Machines.Add(machine); machine.Subscribe(LotOutObserver); } toyFab.AddWorkCenter(workStation.Name, workStation); } foreach (var sequence in toyFabSettings.Sequences) { toyFab.AddSequence(sequence.Key, sequence.Value); } toyFab.SetLotGenerator(new LotGenerator(toyFab, "LotGenerator", Program.NumberOfLots)); }
public void SendToNextWorkStation() { if (Sequence.HasNextStep(CurrentStepCount)) { WorkStation nextWorkStation = GetNextWorkStation; CurrentStepCount++; if (CurrentStepCount == 0) { // Means it is the first step, it is now released in fab so start time can be saved. StartTime = nextWorkStation.GetTime; } nextWorkStation.HandleArrival(this); } else { EndTime = GetCurrentWorkStation.GetTime; } }
public void AddWorkCenter(string name, WorkStation workCenter) { WorkStations.Add(name, workCenter); }
public RLDispatcher(ModelElementBase parent, string name, RLLayerBase rlLayer, double timePerDispatchTrigger) : base(parent, name, rlLayer) { this.workStation = (WorkStation)parent; toyFab = workStation.ToyFab; this.timePerDispatchTrigger = timePerDispatchTrigger; }
public void SetWorkCenter(WorkStation workStation) { WorkStation = workStation; }