public static void RunRLSimulation() { CSSL.Modeling.Settings.WriteOutput = true; RLLayer RLLayer = new RLLayer(LengthOfWarmUp, LengthOfReplication); RLController RLController = new RLController(RLLayer, 200000); RLController.Run(); }
public void Reset() { try { Response response = RLLayer.Reset(); WriteResponse(response); SetFlag(Flag.WAIT); } catch (Exception exception) { throw exception; } }
public void Act() { try { int action = ReadAction(); Response response = RLLayer.Act(action); WriteResponse(response); SetFlag(Flag.WAIT); } catch (Exception exception) { throw exception; } }
static void Main(string[] args) { RLLayer layer = new RLLayer(); RLController controller = new RLController(layer); controller.Run(); // //RLLayer layer = new RLLayer(); //Stopwatch stopwatch = new Stopwatch(); //int reps = 100; //double totalDuration = 0; //Random rnd = new Random(); //ServerPool sp = layer.ac.ServerPool; //for (int i = 0; i < reps; i++) //{ // stopwatch.Restart(); // layer.Reset(); // for (int customers = 0; customers < 6000; customers++) // { // if (sp.FreeServers > 0) // { // layer.Act(rnd.Next(2)); // } // else // { // layer.Act(0); // } // } // totalDuration += stopwatch.Elapsed.TotalSeconds; //} //Console.WriteLine($"Average duration: {totalDuration / reps} seconds."); }
public RLController(RLLayer RLLayer) { this.RLLayer = RLLayer; }