示例#1
0
        public void validate_dependencies_can_be_constructed_by_providers()
        {
            var si = new SimulationInput(
                100,
                "results",
                new SimulationOptions(),
                SourceInputProvider.DirectionalPointSourceInput(),
                TissueInputProvider.MultiLayerTissueInput(),
                new[] { DetectorInputProvider.RDiffuseDetectorInput() }
                );

            Assert.NotNull(si.SourceInput);
            Assert.NotNull(si.TissueInput);
            Assert.NotNull(si.DetectorInputs);
            Assert.IsTrue(si.DetectorInputs.Count == 1);
        }
示例#2
0
        public void validate_fluent_constructed_SimulationInput_runs_simulation_without_crashing()
        {
            var si = new SimulationInput("demoInput")
            {
                N = 30
            }
            .WithSourceInput(SourceInputProvider.DirectionalPointSourceInput())
            .WithTissueInput(TissueInputProvider.MultiLayerTissueInput())
            .WithDetectorInputs(DetectorInputProvider.RDiffuseDetectorInput());

            Assert.NotNull(si.SourceInput);
            Assert.NotNull(si.TissueInput);
            Assert.NotNull(si.DetectorInputs);
            Assert.IsTrue(si.DetectorInputs.Count == 1);

            var mc     = new MonteCarloSimulation(si);
            var output = mc.Run();

            Assert.NotNull(output);
            Assert.True(output.Input.N == 30);
        }