27 #ifndef __POPULATION_H__
28 #define __POPULATION_H__
43 template<
class Indiv
idual_t >
53 typedef typename Individual_t::genes_t
genes_t;
55 typedef std::pair< unsigned int, individual >
ind_t;
78 if(it->second == ind) {
133 for (
unsigned int id : ids) {
150 if( survivors.count(it->first) == 0 ) {
168 if( ind_genes == ind.second->genes_m )
181 std::ostringstream filename;
182 filename <<
"hypervol.dat_" << island_id;
183 file.open(filename.str().c_str(), std::ios::out);
191 for(
size_t i=0; i<temp->objectives_m.size(); i++)
192 file << temp->objectives_m[i] <<
" ";
193 if (!temp->objectives_m.empty())
individual get_staging(int identity)
std::shared_ptr< Individual_t > individual
indItr_t stagingBegin()
iterator begin on staging area
std::map< unsigned int, individual > individuals
population container holding all individuals
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
indItr_t end()
iterator end on population container
unsigned int add_individual(individual ind)
indItr_t begin()
iterator begin on population container
std::queue< unsigned int > freeids
queue to handle free individual IDs
indItr_t erase(indItr_t it)
erase individual
void commit_individuals(std::set< unsigned int > ids)
bool isRepresentedInPopulation(genes_t ind_genes)
check if a gene set is already represented in the population
std::pair< unsigned int, individual > ind_t
Inform & endl(Inform &inf)
indItr_t stagingEnd()
iterator end on staging area
std::string::iterator iterator
double FromFile(std::string file, const std::vector< double > &referencePoint)
unsigned int last_identity
last used (= next free) ID
void commit_individuals()
void keepSurvivors(std::set< unsigned int > survivors)
double computeHypervolume(size_t island_id, const std::vector< double > &referencePoint)
void remove_individual(individual ind)
unsigned int size() const
individual get_individual(int identity)
std::map< unsigned int, individual > stagingArea
staging area for individuals probably joining population
Individual_t::genes_t genes_t
std::map< unsigned int, individual >::iterator indItr_t
population iterator type