コード例 #1
0
        public void ReturnTheOptimumNumberOfLargeVasesIfNonStandardConstraintsAreSupplied()
        {
            var claySupply  = 37;
            var glazeSupply = 31;

            IPotteryOptimizer engine = (null as IPotteryOptimizer).Create();
            var result = engine.GetTargets(claySupply, glazeSupply);

            Assert.AreEqual(3, result.Large);
        }
コード例 #2
0
        public void ReturnTheOptimumNumberOfLargeVases()
        {
            var claySupply  = 24;
            var glazeSupply = 16;

            IPotteryOptimizer engine = (null as IPotteryOptimizer).Create();
            var result = engine.GetTargets(claySupply, glazeSupply);

            Assert.AreEqual(4, result.Large);
        }
コード例 #3
0
        public void ReturnQuicklyEvenAtScale()
        {
            // This test is expected to fail for any optimizer that
            // cannot handle a large solution set, such as
            // the Naive optimizer in this solution.

            var claySupply  = Int32.MaxValue;       // Huge value
            var glazeSupply = Int32.MaxValue - 394; // Huge value picked at random

            IPotteryOptimizer engine = (null as IPotteryOptimizer).Create();
            var result = engine.GetTargets(claySupply, glazeSupply);
        }