Commit 21b69633 authored by David A.. Werner's avatar David A.. Werner
Browse files

Config changes and some basic documentation

parent df70d59e
......@@ -114,6 +114,8 @@ class Manduca(object):
@property
def fitness(self):
""" To use an alternate fitness function, add the function to the class and set
self.fitness_function to be a string containing the function name"""
if (self._fitness is None):
fn = getattr(self, self._fitness_function)
if isinstance(fn, types.FunctionType):
......
......@@ -19,8 +19,8 @@ class EvolutionParameters(object):
self.num_matings = num_matings
self.num_mutants = num_mutants
self.max_mutations = max_mutations
self.num_fittest = kwargs.pop('num_fittest', int(self.max_population/2))
self.num_random = kwargs.pop('num_random', int(self.max_population/5))
self.num_fittest = kwargs.pop('num_fittest', int(self.max_population/2.0))
self.num_random = kwargs.pop('num_random', int(self.max_population/20.0))
def update_parameters(self, history):
"""Basic EvolutionParameters doesn't change as the simulation progresses"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment