GPLIB++
Classes | Public Member Functions | List of all members
gplib::UniquePop Class Reference

This class stores a single unique copy of each population member that is added to it. More...

#include <UniquePop.h>

Public Member Functions

bool Find (const ttranscribed &popmember, tfitvec &fitness)
 
bool Insert (const tfitvec &fitness, const ttranscribed &popmember)
 
void PrintAll (std::ostream &output)
 
 UniquePop ()
 
virtual ~UniquePop ()
 

Detailed Description

This class stores a single unique copy of each population member that is added to it.

In order to avoid duplicate output of inversion results at the end of the genetic algorithm run and have a compact history of all models evaluated during the GA run, we have this class that makes sure that we only have a single copy of each population member. This class also stores the associated fitness values, so we can use it to look up the fitness of a member instead of calculating it if the member has already been evaluated before.

Definition at line 17 of file UniquePop.h.

Constructor & Destructor Documentation

gplib::UniquePop::UniquePop ( )

Definition at line 10 of file UniquePop.cpp.

gplib::UniquePop::~UniquePop ( )
virtual

Definition at line 13 of file UniquePop.cpp.

Member Function Documentation

bool gplib::UniquePop::Find ( const ttranscribed popmember,
tfitvec fitness 
)

Definition at line 25 of file UniquePop.cpp.

Referenced by main().

bool gplib::UniquePop::Insert ( const tfitvec fitness,
const ttranscribed popmember 
)

Definition at line 17 of file UniquePop.cpp.

Referenced by main().

void gplib::UniquePop::PrintAll ( std::ostream &  output)

Definition at line 36 of file UniquePop.cpp.

Referenced by main(), and gplib::GeneralGA::PrintUniquePop().


The documentation for this class was generated from the following files: