示例#1
0
        /// <summary>
        /// Replaces each octave by a random successor.
        /// </summary>
        public void EvolveOctaves()
        {
            for (int index = 0; index < _octaves.Length; index++)
            {
                Octave currentOctave = _octaves[index];
                Octave nextOctave    = currentOctave.GenerateSuccesor();

                _octaves[index] = nextOctave;
            }
        }
示例#2
0
        /// <summary>
        /// Initializes the octaves.
        /// </summary>
        private static Octave[] InitializeOctaves(int octaveCount, float persistence, IRandomGenerator rng, Func <float, float> splineDefinition)
        {
            Octave[] octaves = new Octave[octaveCount];
            for (int index = 1; index <= octaveCount; index++)
            {
                //Calculate values.
                int    pointCount = index + 1;
                double amplitude  = Math.Pow(persistence, index);

                //Initialize Octave.
                Octave octave = new Octave(pointCount, amplitude, rng, splineDefinition);
                octaves[index - 1] = octave;
            }

            return(octaves);
        }