Example #1
0
                public ICandidate mate(ICandidate other)
                {
                    valueCanidate child = new valueCanidate(obj.mate(myVal, ((valueCanidate)other).myVal), obj);

                    child.toOptimze = toOptimze;
                    return(child);
                }
Example #2
0
                public ICandidate clone()
                {
                    valueCanidate cloned = new valueCanidate(obj);

                    cloned.toOptimze = toOptimze;
                    cloned.myVal     = new double[myVal.Length];
                    myVal.CopyTo(cloned.myVal, 0);
                    return(cloned);
                }
Example #3
0
            public static Simulator getOptimizer(Info inObj, int popCount, Func <double[], double> func)
            {
                Simulator ret = new Simulator(popCount);

                //ret.population = new List<ICandidate>(popCount);
                for (int i = 0; i < popCount; i++)
                {
                    valueCanidate canidate = new valueCanidate(inObj);
                    canidate.toOptimze = func;
                    ret.population.Add(canidate);
                }
                return(ret);
            }
Example #4
0
            public static Simulator getOptimizer(double[] mins, double[] maxs, int num, double skewMating, int popCount, Func <double[], double> func)
            {
                Info infoObj = new Info();

                infoObj.minGuesses = mins;
                infoObj.maxGuesses = maxs;
                infoObj.numIn      = num;
                infoObj.skewMating = skewMating;
                Simulator sim = new Simulator(popCount);

                //sim.population = new List<ICandidate>(popCount);
                for (int i = 0; i < popCount; i++)
                {
                    valueCanidate canidate = new valueCanidate(infoObj);
                    canidate.toOptimze = func;
                    sim.population.Add(canidate);
                }
                return(sim);
            }