Logo Search packages:      
Sourcecode: gaffitter version File versions  Download package

void GeneticAlgorithm::Initialize (  )  [protected]

Initialize/adjust some parameters (per iteration) and prints some information if required.

Definition at line 142 of file GeneticAlgorithm.cc.

References Optimizer::m_files, Params::m_ga_mut_prob, Optimizer::m_params, m_prob_mutation, and Params::m_verbose.

Referenced by Evolve().

{
   // Automatic mutation is ~1/L (where L is the gnome's length)
   if (m_params.m_ga_mut_prob < 0.0  ||  m_params.m_ga_mut_prob > 1.0)
   {
        if (m_files.size() <= 10)
           m_prob_mutation = (1+log10((float) m_files.size()))
                                    /static_cast<float>(m_files.size());
        else // input size > 10
           m_prob_mutation = (1+log(10.0)/log((float) m_files.size()))
                                    /static_cast<float>(m_files.size());
   }
   else m_prob_mutation = m_params.m_ga_mut_prob;

   // print the header
   if (m_params.m_verbose) cout << *this;
}


Generated by  Doxygen 1.6.0   Back to index