Exemple #1
0
        public void CompareSliceToNaiveForVariousRadii([Range(2, 20)] int radius)
        {
            var naive = new ParallelNaiveSphereLatticeCalculator();
            var slice = new SliceSphereLatticeCalculator(new TurtleCircleLatticeCalculator());

            var expected = naive.FindLatticePoints(radius).ToArray();
            var actual = slice.FindLatticePoints(radius);

            actual.AssertSequenceEquivalentTo(expected);
        }
        public void GivenExampleTest(IRiskCalculator riskCalculator)
        {
            var calculator = new ParallelNaiveSphereLatticeCalculator();
            var stations = calculator.FindLatticePoints(7).Select(x => new Station(x));
            var actual = riskCalculator.CalculateRisk(stations, 7).TotalRisk;

            Assert.AreEqual(0.1784943998, Math.Round(actual, 10));
        }