Ejemplo n.º 1
0
        private DnaDrawing GetMutatedSeedSyncedDrawing()
        {
            DnaDrawing newDrawing = parentDrawing.Clone();

            newDrawing.Mutate(info);
            return(newDrawing);
        }
Ejemplo n.º 2
0
        public DnaDrawing GetDrawing()
        {
            DnaDrawing newDrawing = CurrentDrawing.Clone();

            newDrawing.Mutate(settings);

            double newErrorLevel = FitnessCalculator.GetDrawingFitness(newDrawing, newDrawing.SourceImage);

            if (newErrorLevel <= CurrentErrorLevel)
            {
                CurrentDrawing    = newDrawing;
                CurrentErrorLevel = newErrorLevel;
            }

            return(CurrentDrawing);
        }
Ejemplo n.º 3
0
        public double GetNextErrorLevel()
        {
            Generations = 0;
            DnaDrawing newDrawing = currentDrawing.Clone();

            while (newDrawing.IsDirty == false)
            {
                newDrawing.Mutate(info);
                Generations++;
            }

            double newErrorLevel = FitnessCalculator.GetDrawingFitness(newDrawing, info.SourceImage);

            if (newErrorLevel <= currentErrorLevel)
            {
                currentDrawing    = newDrawing;
                currentErrorLevel = newErrorLevel;
            }

            return(newErrorLevel);
        }