Exemplo n.º 1
0
        public void WriteToCSVTest()
        {
            double paramLambda = 4;

            double[] roValues = new double[] { 0.25, 0.5, 0.75 };
            string   output   = "";

            foreach (double ro in roValues)
            {
                double paramMi = paramLambda / ro;

                var queueSystem = new Mm1QueueSystem(paramMi, paramLambda);
                var simulator   = new EventSimulator(queueSystem);
                simulator.RunSim();

                output += $"Wartości_dla_Ro_{ro}. Oczekiwane_p0_{1 - ro}\n";
                output += string.Join("\n", simulator.P0Points.Select(point => $"{point.X} {point.Y}"));
                output += "\n\n";
            }



            string path = @"C:\Users\Krzysztof Krupiński\Desktop\data.txt";

            using (var file = new System.IO.StreamWriter(path))
            {
                file.Write(output);
            }


            Console.WriteLine(output);
        }
Exemplo n.º 2
0
        public void ServiceStepTest()
        {
            double[] roValues    = new double[] { 0.25, 0.5, 0.75 };
            double   paramLambda = 4;

            foreach (double ro in roValues)
            {
                double paramMi = paramLambda / ro;

                var queueSystem = new Mm1Continuous(paramMi, paramLambda);
                var simulator   = new EventSimulator(queueSystem);
                simulator.RunSim();
                Console.WriteLine($"Ro: {ro}, P: " + simulator.QueueSystem.TimeStats.ImgClientServicedProbability);
            }
        }
Exemplo n.º 3
0
        public void ChartTest()
        {
            double[] roValues    = new double[] { 0.25, 0.5, 0.75 };
            double   paramLambda = 4;
            double   ro          = 0.25;

            double paramMi = paramLambda / ro;

            var queueSystem = new Mm1QueueSystem(paramMi, paramLambda);
            var simulator   = new EventSimulator(queueSystem);

            simulator.RunSim();

            var chartMaker = new ChartMaker();

            chartMaker.SetData(simulator.P0Points);
            chartMaker.Show();
        }