\hypertarget{classAlgorithm}{
\section{Algorithm Class Reference}
\label{classAlgorithm}\index{Algorithm@{Algorithm}}
}


This is the main algorithm base class; actual algorithms should be derived.  


{\ttfamily \#include $<$Algorithm.hpp$>$}Inheritance diagram for Algorithm::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classAlgorithm}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classAlgorithm_a472bdce2086324f49da7794e27ccaa54}{Algorithm} ()
\begin{DoxyCompactList}\small\item\em Default constructor; doesn't initialize much, so \hyperlink{classAlgorithm_a714513d51dc040abe276c33e897f2190}{setup()} must be called. \item\end{DoxyCompactList}\item 
virtual void \hyperlink{classAlgorithm_a714513d51dc040abe276c33e897f2190}{setup} (const ptree \&all, const string \&outputdirname)
\begin{DoxyCompactList}\small\item\em Setup case-\/specific settings. \item\end{DoxyCompactList}\item 
virtual void \hyperlink{classAlgorithm_a2035d63131f6573cb07662cef84ed742}{run} ()
\begin{DoxyCompactList}\small\item\em Run the algorithm as the setup tells us to. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classAlgorithm_a56f88357532d0a29ed03e6362a02b3da}{
virtual void \hyperlink{classAlgorithm_a56f88357532d0a29ed03e6362a02b3da}{impl\_\-setup} (const ptree \&all)=0}
\label{classAlgorithm_a56f88357532d0a29ed03e6362a02b3da}

\begin{DoxyCompactList}\small\item\em Derived classes must know how to setup their additional data structures. \item\end{DoxyCompactList}\item 
\hypertarget{classAlgorithm_a6f9860bb6f29f8e5d35c7ddd74f829eb}{
virtual size\_\-t \hyperlink{classAlgorithm_a6f9860bb6f29f8e5d35c7ddd74f829eb}{nextID} ()}
\label{classAlgorithm_a6f9860bb6f29f8e5d35c7ddd74f829eb}

\begin{DoxyCompactList}\small\item\em Give the next available ID (running index). \item\end{DoxyCompactList}\item 
void \hyperlink{classAlgorithm_ae1c8bbcba34cc82e70b697be3d821744}{markAsParents} (size\_\-t childID, const vector$<$ size\_\-t $>$ \&parentIDs)
\begin{DoxyCompactList}\small\item\em Remember a parenting relationship, for tracing the runs. \item\end{DoxyCompactList}\item 
void \hyperlink{classAlgorithm_af94b2b718a80c47c1093932ceaaa0fc0}{traceMeasures} (size\_\-t childID, const vector$<$ double $>$ \&measures)
\begin{DoxyCompactList}\small\item\em Trace some measures of an individual, possibly more than just objectives. \item\end{DoxyCompactList}\item 
void \hyperlink{classAlgorithm_a2c72bff18f15ee52fe8a78b04a5dcc3b}{writeParentHistory} (ostream \&os) const 
\begin{DoxyCompactList}\small\item\em Write the traced parenting history to a stream. \item\end{DoxyCompactList}\item 
void \hyperlink{classAlgorithm_a8188719c3ba949162da7cadd7fbd0643}{writeTracedMeasures} (ostream \&os) const 
\begin{DoxyCompactList}\small\item\em Write the traced measures to a stream. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
size\_\-t \hyperlink{classAlgorithm_ac6e80481b9a3692c3b4921cc374179d9}{\_\-maxiter}
\begin{DoxyCompactList}\small\item\em Number of generations to carry out. \item\end{DoxyCompactList}\item 
string \hyperlink{classAlgorithm_a4f7965ef5a7bd925d8948f9f801d9bcc}{\_\-outputdirname}
\begin{DoxyCompactList}\small\item\em Output directory in which all the results and traces will be saved. \item\end{DoxyCompactList}\item 
size\_\-t \hyperlink{classAlgorithm_a16b384a5f239435943a83c72957470b9}{\_\-nextID} = 1
\begin{DoxyCompactList}\small\item\em Next ID to give to a modified individual (unique running index). \item\end{DoxyCompactList}\item 
vector$<$ vector$<$ size\_\-t $>$ $>$ \hyperlink{classAlgorithm_ae2555e5fe21979ade6bb26bda423a6f2}{\_\-parentsOf}
\begin{DoxyCompactList}\small\item\em The IDs of parents; for tracing the algorithm progression. \item\end{DoxyCompactList}\item 
vector$<$ vector$<$ double $>$ $>$ \hyperlink{classAlgorithm_a5f8220a684a2e09beb06efacfd9117be}{\_\-tracedMeasures}
\begin{DoxyCompactList}\small\item\em Traced measures; for tracing the algorithm progression. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This is the main algorithm base class; actual algorithms should be derived. This base class offers the general framework for setup and iterative running, but knows nothing about individual representation or operators actually used. This also handles the \char`\"{}dirty and mundane work\char`\"{} of logging outputs etc. Formatting can, of course, be done only by derived classes that know about the actual representation.

Boost property\_\-tree is used for setup, because of its nice parser for structured configuration. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classAlgorithm_a472bdce2086324f49da7794e27ccaa54}{
\index{Algorithm@{Algorithm}!Algorithm@{Algorithm}}
\index{Algorithm@{Algorithm}!Algorithm@{Algorithm}}
\subsubsection[{Algorithm}]{\setlength{\rightskip}{0pt plus 5cm}Algorithm::Algorithm ()}}
\label{classAlgorithm_a472bdce2086324f49da7794e27ccaa54}


Default constructor; doesn't initialize much, so \hyperlink{classAlgorithm_a714513d51dc040abe276c33e897f2190}{setup()} must be called. 

\subsection{Member Function Documentation}
\hypertarget{classAlgorithm_ae1c8bbcba34cc82e70b697be3d821744}{
\index{Algorithm@{Algorithm}!markAsParents@{markAsParents}}
\index{markAsParents@{markAsParents}!Algorithm@{Algorithm}}
\subsubsection[{markAsParents}]{\setlength{\rightskip}{0pt plus 5cm}void Algorithm::markAsParents (size\_\-t {\em childID}, \/  const vector$<$ size\_\-t $>$ \& {\em parentIDs})\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_ae1c8bbcba34cc82e70b697be3d821744}


Remember a parenting relationship, for tracing the runs. \hypertarget{classAlgorithm_a2035d63131f6573cb07662cef84ed742}{
\index{Algorithm@{Algorithm}!run@{run}}
\index{run@{run}!Algorithm@{Algorithm}}
\subsubsection[{run}]{\setlength{\rightskip}{0pt plus 5cm}void Algorithm::run ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classAlgorithm_a2035d63131f6573cb07662cef84ed742}


Run the algorithm as the setup tells us to. 

Reimplemented in \hyperlink{classMlpLearnAlgorithm_ae95158035f9024ba21045f737fecf74c}{MlpLearnAlgorithm}.\hypertarget{classAlgorithm_a714513d51dc040abe276c33e897f2190}{
\index{Algorithm@{Algorithm}!setup@{setup}}
\index{setup@{setup}!Algorithm@{Algorithm}}
\subsubsection[{setup}]{\setlength{\rightskip}{0pt plus 5cm}void Algorithm::setup (const ptree \& {\em all}, \/  const string \& {\em outputdirname})\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classAlgorithm_a714513d51dc040abe276c33e897f2190}


Setup case-\/specific settings. \hypertarget{classAlgorithm_af94b2b718a80c47c1093932ceaaa0fc0}{
\index{Algorithm@{Algorithm}!traceMeasures@{traceMeasures}}
\index{traceMeasures@{traceMeasures}!Algorithm@{Algorithm}}
\subsubsection[{traceMeasures}]{\setlength{\rightskip}{0pt plus 5cm}void Algorithm::traceMeasures (size\_\-t {\em childID}, \/  const vector$<$ double $>$ \& {\em measures})\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_af94b2b718a80c47c1093932ceaaa0fc0}


Trace some measures of an individual, possibly more than just objectives. \hypertarget{classAlgorithm_a2c72bff18f15ee52fe8a78b04a5dcc3b}{
\index{Algorithm@{Algorithm}!writeParentHistory@{writeParentHistory}}
\index{writeParentHistory@{writeParentHistory}!Algorithm@{Algorithm}}
\subsubsection[{writeParentHistory}]{\setlength{\rightskip}{0pt plus 5cm}void Algorithm::writeParentHistory (ostream \& {\em os}) const\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_a2c72bff18f15ee52fe8a78b04a5dcc3b}


Write the traced parenting history to a stream. \hypertarget{classAlgorithm_a8188719c3ba949162da7cadd7fbd0643}{
\index{Algorithm@{Algorithm}!writeTracedMeasures@{writeTracedMeasures}}
\index{writeTracedMeasures@{writeTracedMeasures}!Algorithm@{Algorithm}}
\subsubsection[{writeTracedMeasures}]{\setlength{\rightskip}{0pt plus 5cm}void Algorithm::writeTracedMeasures (ostream \& {\em os}) const\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_a8188719c3ba949162da7cadd7fbd0643}


Write the traced measures to a stream. 

\subsection{Member Data Documentation}
\hypertarget{classAlgorithm_ac6e80481b9a3692c3b4921cc374179d9}{
\index{Algorithm@{Algorithm}!\_\-maxiter@{\_\-maxiter}}
\index{\_\-maxiter@{\_\-maxiter}!Algorithm@{Algorithm}}
\subsubsection[{\_\-maxiter}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t {\bf Algorithm::\_\-maxiter}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_ac6e80481b9a3692c3b4921cc374179d9}


Number of generations to carry out. \hypertarget{classAlgorithm_a16b384a5f239435943a83c72957470b9}{
\index{Algorithm@{Algorithm}!\_\-nextID@{\_\-nextID}}
\index{\_\-nextID@{\_\-nextID}!Algorithm@{Algorithm}}
\subsubsection[{\_\-nextID}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t {\bf Algorithm::\_\-nextID} = 1\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_a16b384a5f239435943a83c72957470b9}


Next ID to give to a modified individual (unique running index). \hypertarget{classAlgorithm_a4f7965ef5a7bd925d8948f9f801d9bcc}{
\index{Algorithm@{Algorithm}!\_\-outputdirname@{\_\-outputdirname}}
\index{\_\-outputdirname@{\_\-outputdirname}!Algorithm@{Algorithm}}
\subsubsection[{\_\-outputdirname}]{\setlength{\rightskip}{0pt plus 5cm}string {\bf Algorithm::\_\-outputdirname}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_a4f7965ef5a7bd925d8948f9f801d9bcc}


Output directory in which all the results and traces will be saved. \hypertarget{classAlgorithm_ae2555e5fe21979ade6bb26bda423a6f2}{
\index{Algorithm@{Algorithm}!\_\-parentsOf@{\_\-parentsOf}}
\index{\_\-parentsOf@{\_\-parentsOf}!Algorithm@{Algorithm}}
\subsubsection[{\_\-parentsOf}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ vector $<$size\_\-t$>$ $>$ {\bf Algorithm::\_\-parentsOf}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_ae2555e5fe21979ade6bb26bda423a6f2}


The IDs of parents; for tracing the algorithm progression. \hypertarget{classAlgorithm_a5f8220a684a2e09beb06efacfd9117be}{
\index{Algorithm@{Algorithm}!\_\-tracedMeasures@{\_\-tracedMeasures}}
\index{\_\-tracedMeasures@{\_\-tracedMeasures}!Algorithm@{Algorithm}}
\subsubsection[{\_\-tracedMeasures}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ vector $<$double$>$ $>$ {\bf Algorithm::\_\-tracedMeasures}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{classAlgorithm_a5f8220a684a2e09beb06efacfd9117be}


Traced measures; for tracing the algorithm progression. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
src/Algorithm.hpp\item 
src/Algorithm.cpp\end{DoxyCompactItemize}
