コード例 #1
0
 private void ShowList(ProcessSimulation ps)
 {
     Console.Out.WriteLine("Time:" + ps.Time);
     Console.Out.WriteLine("Waiting:" + ListToString(ps.waitingPool));
     Console.Out.WriteLine("Ready:" + ListToString(ps.readyPool.Array()));
     Console.Out.WriteLine("Running:" + ListToString(ps.runningPool));
     Console.Out.WriteLine("Finished:" + ListToString(ps.finishedPool));
     Console.Out.WriteLine("Blocked:" + ListToString(ps.blockedPool));
 }
コード例 #2
0
        public async Task Start()
        {
            if (timer == null)
            {
                timer = new Timer(NotifySimulationNextStep);
            }

            // var caseParser = new SimulationCaseParser();
            var parser = new ProcessKindXmlParser();

            var xml = await SimulationCases.LoadXmlAsync(SimulationCases.ModelDefinition);

            processKind = parser.ParseDefinition(xml);

            var caseXml = await SimulationCases.LoadXmlAsync(SimulationCases.Case01);

            simulation = new RentalContractSimulationFromXml(caseXml);
            simulation.Prepare();

            //send model definition
            await Hub.Clients.All.NotifyStart(processKind);

            timer.Change(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1));
        }
コード例 #3
0
 public Simulator(ProcessSimulation simulation)
 {
     this.simulation = simulation;
 }