public override void BuildTrainingEnvironment() { Settings.WriteOutput = false; Simulation = new RLSimulation("Access_controller_simulation"); ac = new AccessController(Simulation.MyModel, "Access_controller", this); }
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)); }
static void Main(string[] args) { RLSimulation sim = new RLSimulation("Access_controller"); }