Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EntityRandomizer.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file EntityRandomizer.hh
11 /// @brief controls the alteration of the traits that define Entity
12 /// @author ashworth
13 
14 #ifndef INCLUDED_protocols_genetic_algorithm_EntityRandomizer_hh
15 #define INCLUDED_protocols_genetic_algorithm_EntityRandomizer_hh
16 
18 
19 #include <utility/pointer/ReferenceCount.hh>
20 
21 #include <core/types.hh>
22 // AUTO-REMOVED #include <basic/Tracer.hh>
23 #include <utility/vector1.hh>
24 // AUTO-REMOVED #include <numeric/random/random.hh>
25 
26 // AUTO-REMOVED #include <numeric/random/random.fwd.hh>
27 
28 #include <algorithm> // std::copy
29 
30 namespace protocols {
31 namespace genetic_algorithm {
32 
33 ////////////////////////////////////////////////////////////////////////////////////////////////////
35 
36 public:
41 
43  virtual ~EntityRandomizer();
44  virtual EntityOP random_entity();
45  virtual void mutate( Entity & entity ) = 0;
46  virtual void crossover( Entity & entity1, Entity & entity2 );
47 
48  virtual core::Size entity_length() const { return entity_length_; }
49  virtual void set_mutation_rate( core::Real rate ) { mutation_rate_ = rate; }
50  virtual core::Real mutation_rate() const { return mutation_rate_; }
51  virtual core::Size library_size() const = 0;
52  virtual EntityCOP entity_template() const;
53  virtual void set_entity_template(EntityCOP entity);
54 
55 protected:
56  virtual void set_entity_length( core::Size length );
57 
58 private:
62 };
63 
64 ////////////////////////////////////////////////////////////////////////////////////////////////////
66 public:
67 
68  virtual ~DiscreteRandomizer();
69  virtual void add_choice( EntityElementOP const & choice );
70  virtual void set_choices( EntityElements const & choices );
71  virtual void mutate( Entity & entity );
72  virtual core::Size library_size() const;
73  virtual EntityElements const & choices() const;
74 private:
76 };
77 
78 ////////////////////////////////////////////////////////////////////////////////////////////////////
79 ///@brief different set of choices at each position in Entity's traits
81 public:
84 
86  virtual void append_choices( EntityElements const & choices );
87  virtual void mutate( Entity & entity );
88  virtual core::Size library_size() const;
89  virtual utility::vector1< EntityElements > const & choices() const;
90 private:
92 };
93 
94 
95 } // namespace genetic_algorithm
96 } // namespace protocols
97 
98 #endif