Пример #1
0
        public void ExtracorporealBloodCircuitWorks_ModelChecking()
        {
            var specification = new ExtracorporealBloodCircuitTestEnvironment();
            var analysis      = new SafetySharpSafetyAnalysis();

            var result = analysis.ComputeMinimalCriticalSets(specification, specification.Dialyzer.MembraneIntact == false);

            result.SaveCounterExamples("counter examples/hdmachine");

            Console.WriteLine(result);
        }
Пример #2
0
        public void ExtracorporealBloodCircuitWorks_Simulation()
        {
            var specification = new ExtracorporealBloodCircuitTestEnvironment();

            var simulator = new SafetySharpSimulator(specification);             //Important: Call after all objects have been created
            var extracorporealBloodCircuitAfterStep0 = simulator.Model.Roots.OfType <ExtracorporealBloodCircuit>().First();
            var patientAfterStep0 = simulator.Model.Roots.OfType <Patient>().First();

            Console.Out.WriteLine("Initial");
            patientAfterStep0.ArteryFlow.Outgoing.Forward.PrintBloodValues("outgoing Blood");
            patientAfterStep0.VeinFlow.Incoming.Forward.PrintBloodValues("incoming Blood");
            patientAfterStep0.PrintBloodValues("");
            Console.Out.WriteLine("Step 1");
            simulator.SimulateStep();

            /*
             * //dialyzerAfterStep1.Should().Be(1);
             * patientAfterStep4.BigWasteProducts.Should().Be(0);
             * patientAfterStep4.SmallWasteProducts.Should().Be(2);
             */
        }
		public void ExtracorporealBloodCircuitWorks_ModelChecking()
		{
			var specification = new ExtracorporealBloodCircuitTestEnvironment();
			var analysis = new SafetyAnalysis();

			var result = analysis.ComputeMinimalCriticalSets(specification, specification.Dialyzer.MembraneIntact == false);
			result.SaveCounterExamples("counter examples/hdmachine");

			Console.WriteLine(result);
		}
		public void ExtracorporealBloodCircuitWorks_Simulation()
		{
			var specification = new ExtracorporealBloodCircuitTestEnvironment();

			var simulator = new Simulator(specification); //Important: Call after all objects have been created
			var extracorporealBloodCircuitAfterStep0 = simulator.Model.Roots.OfType<ExtracorporealBloodCircuit>().First();
			var patientAfterStep0 = simulator.Model.Roots.OfType<Patient>().First();
			Console.Out.WriteLine("Initial");
			patientAfterStep0.ArteryFlow.Outgoing.Forward.PrintBloodValues("outgoing Blood");
			patientAfterStep0.VeinFlow.Incoming.Forward.PrintBloodValues("incoming Blood");
			patientAfterStep0.PrintBloodValues("");
			Console.Out.WriteLine("Step 1");
			simulator.SimulateStep();

			/*
			//dialyzerAfterStep1.Should().Be(1);
			patientAfterStep4.BigWasteProducts.Should().Be(0);
			patientAfterStep4.SmallWasteProducts.Should().Be(2);
			*/
		}