Rosetta 3.4
Public Types | Public Member Functions
protocols::genetic_algorithm::GeneticAlgorithm Class Reference

#include <GeneticAlgorithm.hh>

Inheritance diagram for protocols::genetic_algorithm::GeneticAlgorithm:
Inheritance graph
[legend]
Collaboration diagram for protocols::genetic_algorithm::GeneticAlgorithm:
Collaboration graph
[legend]

List of all members.

Public Types

typedef FitnessFunction::OP FitnessFunctionOP
typedef EntityRandomizer::OP EntityRandomizerOP
typedef Entity::OP EntityOP
typedef Entity::COP EntityCOP
typedef Entity::COPs EntityCOPs
typedef Entity::CAP EntityCAP
typedef Entity::CAPs EntityCAPs
typedef utility::vector1
< EntityOP >::iterator 
pop_iter
typedef utility::vector1
< EntityOP >::const_iterator 
pop_const_iter
typedef utility::vector1
< EntityCOP >::const_iterator 
pop_const_const_iter
typedef boost::unordered_map
< EntityElements, EntityOP,
Vec1Hash, EntityElementsEqual
TraitEntityHashMap

Public Member Functions

 GeneticAlgorithm ()
virtual ~GeneticAlgorithm ()
virtual EntityOP add_entity (EntityElements const &traits)
virtual EntityOP add_entity (EntityOP entity)
virtual EntityOP add_parent_entity (EntityElements const &traits)
virtual EntityOP add_parent_entity (EntityOP entity)
virtual void clear_parents ()
virtual void add_parents_from_current_generation ()
virtual void propagate_best_from_previous_generation (core::Size size=1, bool unique=true)
 add the best entities from the previous generation
virtual void fill_with_random_entities (core::Size size=0)
virtual void fill_by_crossover (core::Size size=0)
 add entities that are recombinants of fit parents
virtual void fill_by_mutation (core::Size size=0)
 add entities that are mutants of fit parents
virtual void evaluate_fitnesses ()
virtual void evolve_next_generation ()
 progress to the next generation and generate new entities
virtual bool current_generation_complete ()
virtual bool complete ()
virtual core::Real best_fitness_from_current_generation () const
virtual void set_func (FitnessFunctionOP f)
virtual void set_rand (EntityRandomizerOP r)
virtual core::Size current_generation () const
virtual core::Size max_generations () const
virtual void set_max_generations (core::Size s)
virtual void set_max_pop_size (core::Size s)
virtual void set_num_to_propagate (core::Size s)
virtual void set_frac_by_recomb (core::Real f)
virtual void set_checkpoint_prefix (std::string const &p)
virtual void set_checkpoint_write_interval (core::Size i)
virtual void set_checkpoint_gzip (bool b)
virtual void set_checkpoint_rename (bool b)
virtual EntityCAPs best_entities (core::Size num)
 non-const to permit sort
virtual Entity const & tournament_select (utility::vector1< EntityCOP > const &pvec) const
 pick two random entities from an unordered vector, return the one whose fitness is better
virtual TraitEntityHashMapentity_cache ()
virtual TraitEntityHashMap const & entity_cache () const
virtual utility::vector1
< utility::vector1< EntityOP >
> const & 
generations () const
virtual EntityCOPs population (core::Size gen_num) const
 true const (read-only) access to entity population: new vector of const pointers
virtual void print_generation_statistics (std::ostream &os, core::Size gen_num) const
virtual void print_population (std::ostream &) const
virtual void print_cache (std::ostream &) const
virtual std::string entities_checkpoint_filename (std::string suffix="") const
virtual bool read_entities_checkpoint (bool overwrite=false)
 for checkpointing fitness cache
virtual bool write_entities_checkpoint () const
 for checkpointing fitness cache
virtual std::string generations_checkpoint_filename (std::string suffix="") const
virtual bool write_generations_checkpoint () const
 This seems to duplicate the functionality of the Entity's write_checkpoint function...
virtual bool read_generations_checkpoint ()
virtual bool read_checkpoint ()
virtual void rename_checkpoint_files () const
 allows the prevention of accidental reuse of checkpoint files
virtual EntityCOP entity_template () const
virtual void set_entity_template (EntityCOP entity)
virtual EntityOP new_entity ()

Member Typedef Documentation


Constructor & Destructor Documentation

protocols::genetic_algorithm::GeneticAlgorithm::GeneticAlgorithm ( )
protocols::genetic_algorithm::GeneticAlgorithm::~GeneticAlgorithm ( ) [virtual]

Member Function Documentation

Entity::OP protocols::genetic_algorithm::GeneticAlgorithm::add_entity ( EntityElements const &  traits) [virtual]
Entity::OP protocols::genetic_algorithm::GeneticAlgorithm::add_entity ( EntityOP  entity) [virtual]
Entity::OP protocols::genetic_algorithm::GeneticAlgorithm::add_parent_entity ( EntityOP  entity) [virtual]
Entity::OP protocols::genetic_algorithm::GeneticAlgorithm::add_parent_entity ( EntityElements const &  traits) [virtual]

References new_entity().

void protocols::genetic_algorithm::GeneticAlgorithm::add_parents_from_current_generation ( ) [virtual]

Referenced by evolve_next_generation().

Entity::CAPs protocols::genetic_algorithm::GeneticAlgorithm::best_entities ( core::Size  num) [virtual]

non-const to permit sort

returns variable number of best (const) entities via vector of pointers to them

References make_table_of_pilot_apps::begin, and core::sequence::end.

core::Real protocols::genetic_algorithm::GeneticAlgorithm::best_fitness_from_current_generation ( ) const [virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::clear_parents ( ) [virtual]
bool protocols::genetic_algorithm::GeneticAlgorithm::complete ( ) [virtual]
virtual core::Size protocols::genetic_algorithm::GeneticAlgorithm::current_generation ( ) const [inline, virtual]
bool protocols::genetic_algorithm::GeneticAlgorithm::current_generation_complete ( ) [virtual]

Referenced by complete().

std::string protocols::genetic_algorithm::GeneticAlgorithm::entities_checkpoint_filename ( std::string  suffix = "") const [virtual]
GeneticAlgorithm::TraitEntityHashMap & protocols::genetic_algorithm::GeneticAlgorithm::entity_cache ( ) [virtual]
GeneticAlgorithm::TraitEntityHashMap const & protocols::genetic_algorithm::GeneticAlgorithm::entity_cache ( ) const [virtual]
EntityCOP protocols::genetic_algorithm::GeneticAlgorithm::entity_template ( ) const [virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::evaluate_fitnesses ( ) [virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::evolve_next_generation ( ) [virtual]

progress to the next generation and generate new entities

This method performs the following steps:

1. If parent entities were not already specified, sets the parents to the current generation 2. Increments the generation counter 3. Copies the best scoring entities from the previous generation to the new one 4. Generates new entities by crossover and/or mutation 5. Clears the parent entities now that they have been used

References add_parents_from_current_generation(), fill_by_crossover(), fill_by_mutation(), and propagate_best_from_previous_generation().

void protocols::genetic_algorithm::GeneticAlgorithm::fill_by_crossover ( core::Size  size = 0) [virtual]

add entities that are recombinants of fit parents

References add_entity(), protocols::genetic_algorithm::Entity::clone(), and tournament_select().

Referenced by evolve_next_generation().

void protocols::genetic_algorithm::GeneticAlgorithm::fill_by_mutation ( core::Size  size = 0) [virtual]

add entities that are mutants of fit parents

References add_entity(), protocols::genetic_algorithm::Entity::clone(), and tournament_select().

Referenced by evolve_next_generation().

void protocols::genetic_algorithm::GeneticAlgorithm::fill_with_random_entities ( core::Size  size = 0) [virtual]

References add_entity().

utility::vector1< utility::vector1< EntityOP > > const & protocols::genetic_algorithm::GeneticAlgorithm::generations ( ) const [virtual]
std::string protocols::genetic_algorithm::GeneticAlgorithm::generations_checkpoint_filename ( std::string  suffix = "") const [virtual]
virtual core::Size protocols::genetic_algorithm::GeneticAlgorithm::max_generations ( ) const [inline, virtual]
Entity::OP protocols::genetic_algorithm::GeneticAlgorithm::new_entity ( ) [virtual]
Entity::COPs protocols::genetic_algorithm::GeneticAlgorithm::population ( core::Size  gen_num) const [virtual]

true const (read-only) access to entity population: new vector of const pointers

true const (read-only) access to entity population

void protocols::genetic_algorithm::GeneticAlgorithm::print_cache ( std::ostream &  os) const [virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::print_generation_statistics ( std::ostream &  os,
core::Size  gen_num 
) const [virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::print_population ( std::ostream &  os) const [virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::propagate_best_from_previous_generation ( core::Size  size = 1,
bool  unique = true 
) [virtual]

add the best entities from the previous generation

References add_entity().

Referenced by evolve_next_generation().

bool protocols::genetic_algorithm::GeneticAlgorithm::read_checkpoint ( ) [virtual]
bool protocols::genetic_algorithm::GeneticAlgorithm::read_entities_checkpoint ( bool  overwrite = false) [virtual]

for checkpointing fitness cache

References entities_checkpoint_filename(), new_entity(), and protocols::genetic_algorithm::TR().

Referenced by read_checkpoint().

bool protocols::genetic_algorithm::GeneticAlgorithm::read_generations_checkpoint ( ) [virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::rename_checkpoint_files ( ) const [virtual]

allows the prevention of accidental reuse of checkpoint files

References entities_checkpoint_filename(), protocols::swa::rna::file_exists(), and generations_checkpoint_filename().

Referenced by ~GeneticAlgorithm().

virtual void protocols::genetic_algorithm::GeneticAlgorithm::set_checkpoint_gzip ( bool  b) [inline, virtual]
virtual void protocols::genetic_algorithm::GeneticAlgorithm::set_checkpoint_prefix ( std::string const &  p) [inline, virtual]
virtual void protocols::genetic_algorithm::GeneticAlgorithm::set_checkpoint_rename ( bool  b) [inline, virtual]
virtual void protocols::genetic_algorithm::GeneticAlgorithm::set_checkpoint_write_interval ( core::Size  i) [inline, virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::set_entity_template ( EntityCOP  entity) [virtual]
virtual void protocols::genetic_algorithm::GeneticAlgorithm::set_frac_by_recomb ( core::Real  f) [inline, virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::set_func ( FitnessFunctionOP  f) [virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::set_max_generations ( core::Size  s) [virtual]
virtual void protocols::genetic_algorithm::GeneticAlgorithm::set_max_pop_size ( core::Size  s) [inline, virtual]
virtual void protocols::genetic_algorithm::GeneticAlgorithm::set_num_to_propagate ( core::Size  s) [inline, virtual]
void protocols::genetic_algorithm::GeneticAlgorithm::set_rand ( EntityRandomizerOP  r) [virtual]
Entity const & protocols::genetic_algorithm::GeneticAlgorithm::tournament_select ( utility::vector1< EntityCOP > const &  pvec) const [virtual]

pick two random entities from an unordered vector, return the one whose fitness is better

References protocols::genetic_algorithm::Entity::fitness().

Referenced by fill_by_crossover(), and fill_by_mutation().

bool protocols::genetic_algorithm::GeneticAlgorithm::write_entities_checkpoint ( ) const [virtual]

for checkpointing fitness cache

References entities_checkpoint_filename(), and print_cache().

Referenced by evaluate_fitnesses().

bool protocols::genetic_algorithm::GeneticAlgorithm::write_generations_checkpoint ( ) const [virtual]

This seems to duplicate the functionality of the Entity's write_checkpoint function...

References generations_checkpoint_filename().

Referenced by evaluate_fitnesses().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines