예제 #1
0
        private IObjectiveScores[] createSample(bool converged = false)
        {
            /*
             * > s = rnorm(7, 1000, 12)
             * [1] 1024.0471  980.6007 1006.0446  972.9169 1000.0527 1004.0899 1008.8202
             * > sd(s)/mean(s)
             * [1] 0.01741291
             * [1] 1001.3914 1005.0520 1015.2980 1016.9730  981.3532 1000.1558  999.8205
             * > sd(s)/mean(s)
             * [1] 0.01179792
             * [1]  960.8459  880.2550  918.0862  964.6065  994.5268  910.9359 1204.6796
             * > sd(s)/mean(s)
             * [1] 0.1104401
             * [1]  ,  955.1453 1155.3053 1147.6358 1020.7405  910.9917  723.9004
             * > sd(s)/mean(s)
             * [1] 0.1555959
             */

            var pset = new TestHyperCube[7];

            double[] narrow_one = { 1024.0471, 980.6007, 1006.0446, 972.9169, 1000.0527, 1004.0899, 1008.8202 };
            double[] narrow_two = { 1001.3914, 1005.0520, 1015.2980, 1016.9730, 981.3532, 1000.1558, 999.8205 };
            double[] large_one  = { 960.8459, 880.2550, 918.0862, 964.6065, 994.5268, 910.9359, 1204.6796 };
            double[] large_two  = { 899.5851, 955.1453, 1155.3053, 1147.6358, 1020.7405, 910.9917, 723.9004 };

            for (int i = 0; i < narrow_one.Length; i++)
            {
                pset[i] = new TestHyperCube(2, 1000, 0, 4000);
                pset[i].SetValues(narrow_one[i], (converged ? narrow_two[i] : large_one[i]));
            }
            var d = new DoubleObjectiveScore("FakeNSE", 0.5, true);

            return(Array.ConvertAll(pset, (x => new MultipleScores <TestHyperCube>(new IObjectiveScore[] { d }, x))));
        }
예제 #2
0
        public override IHyperCube <double> HomotheticTransform(IHyperCube <double> point, double factor)
        {
            var pt = point as TestHyperCube;
            HyperCube <double> result = new TestHyperCube(this.Dimensions);

            performHomoteticTransform(point, factor, ref result);
            return(result);
        }
예제 #3
0
 public TestHyperCube(int p, double val, double min, double max)
     : base(TestHyperCube.ramp(p))
 {
     foreach (var varName in this.GetVariableNames())
     {
         this.SetMinValue(varName, min);
         this.SetMaxValue(varName, max);
         this.SetValue(varName, val);
     }
 }
예제 #4
0
        public static TestHyperCube CreatePoint(double val, double min, double max, params double[] components)
        {
            var hc = new TestHyperCube(components.Length, val, min, max);

            for (int i = 0; i < components.Length; i++)
            {
                hc.SetValue(i.ToString(), components[i]);
            }
            return(hc);
        }
예제 #5
0
 private TestHyperCube(int p)
     : base(TestHyperCube.ramp(p))
 {
 }
예제 #6
0
 private static TestHyperCube createPoint(double x, double y, double z)
 {
     return(TestHyperCube.CreatePoint(0, 0, 10, x, y, z));
 }