\hypertarget{classIndividual}{
\section{Individual Class Reference}
\label{classIndividual}\index{Individual@{Individual}}
}


Base class for the individuals in a Pareto optimization population.  


{\ttfamily \#include $<$Individual.hpp$>$}Inheritance diagram for Individual::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classIndividual}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classIndividual_a375e27b7b7cac8008991b690e7967a0f}{Individual} ()
\begin{DoxyCompactList}\small\item\em Create uninitialized; only for reading from stream very soon. \item\end{DoxyCompactList}\item 
\hyperlink{classIndividual_af44020c83a517658392839205b3f5479}{Individual} (size\_\-t numObjectives)
\begin{DoxyCompactList}\small\item\em Create and initialize; should call this from derived constructor. \item\end{DoxyCompactList}\item 
\hypertarget{classIndividual_a73120be45070fa042e32e61fdf149b15}{
virtual \hyperlink{classIndividual}{Individual} $\ast$ \hyperlink{classIndividual_a73120be45070fa042e32e61fdf149b15}{clone} ()=0}
\label{classIndividual_a73120be45070fa042e32e61fdf149b15}

\begin{DoxyCompactList}\small\item\em Cloning can use the default copy constructor, but otherwise it is specific to the derived classes. \item\end{DoxyCompactList}\item 
virtual void \hyperlink{classIndividual_a4bc4ae3cc82bcb6e27600f597fe0136b}{evaluate} ()=0
\begin{DoxyCompactList}\small\item\em Evaluate objective functions. \item\end{DoxyCompactList}\item 
virtual void \hyperlink{classIndividual_aa86bbece0507640edb4f4b2714a162f4}{mutate} ()=0
\begin{DoxyCompactList}\small\item\em Apply evolutionary mutation operator(s). \item\end{DoxyCompactList}\item 
virtual void \hyperlink{classIndividual_ad56de759959b719e51873c1cabe574a1}{improve} (mt19937 $\ast$mt)=0
\begin{DoxyCompactList}\small\item\em Apply memetic improvement operator(s). \item\end{DoxyCompactList}\item 
virtual pair$<$ unique\_\-ptr$<$ \hyperlink{classIndividual}{Individual} $>$, unique\_\-ptr$<$ \hyperlink{classIndividual}{Individual} $>$ $>$ \hyperlink{classIndividual_aa4b376475c4078ed8decc17c16f26c1b}{crossWith} (\hyperlink{classIndividual}{Individual} \&other)=0
\begin{DoxyCompactList}\small\item\em Binary cross-\/over with another individual. \item\end{DoxyCompactList}\item 
\hypertarget{classIndividual_a45dd9e59964f78aa4aeebe001e92069c}{
virtual int {\bfseries getId} ()}
\label{classIndividual_a45dd9e59964f78aa4aeebe001e92069c}

\item 
\hypertarget{classIndividual_ab39103a2152a7e18c615607d8968358b}{
virtual void {\bfseries setId} (int id)}
\label{classIndividual_ab39103a2152a7e18c615607d8968358b}

\item 
\hypertarget{classIndividual_af01fdd1ff155ade113a8de18fd1af7a1}{
virtual int {\bfseries getRank} ()}
\label{classIndividual_af01fdd1ff155ade113a8de18fd1af7a1}

\item 
\hypertarget{classIndividual_afce662d7ff1eaa702d6d8413684f9d3c}{
virtual void {\bfseries setRank} (int rank)}
\label{classIndividual_afce662d7ff1eaa702d6d8413684f9d3c}

\item 
\hypertarget{classIndividual_a46ce36e4742b91afc343bb44fde36367}{
virtual double {\bfseries getCrowdingDistance} ()}
\label{classIndividual_a46ce36e4742b91afc343bb44fde36367}

\item 
\hypertarget{classIndividual_ac75b869af9bd25d3f6cbad82a2f1f4a7}{
virtual void {\bfseries setCrowdingDistance} (double crowdingDistance)}
\label{classIndividual_ac75b869af9bd25d3f6cbad82a2f1f4a7}

\item 
\hypertarget{classIndividual_a268ae9a1c5caa8ea1b2c9fdb39609514}{
virtual double {\bfseries getObjective} (size\_\-t index)}
\label{classIndividual_a268ae9a1c5caa8ea1b2c9fdb39609514}

\item 
\hypertarget{classIndividual_ae399ab91dbc6306e6145abaf28aff87f}{
virtual void {\bfseries setObjective} (size\_\-t index, double value)}
\label{classIndividual_ae399ab91dbc6306e6145abaf28aff87f}

\item 
virtual vector$<$ double $>$ \hyperlink{classIndividual_a96eba94e7973e8f55588bd7cb8dc2be9}{getTrace} ()
\begin{DoxyCompactList}\small\item\em Get measures that are interesting in post-\/run tracing; subclasses would know which measures are of importance. \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{classIndividual_a29508de0e315c8cf19e659d2b01bc9ab}{winsTournamentAgainst} (const \hyperlink{classIndividual}{Individual} \&opponent, mt19937 $\ast$mt)
\begin{DoxyCompactList}\small\item\em Returns true if this individual is better than another in the NSGA-\/II -\/sense, i.e., based on dominance, crowding distance within non-\/dominated solutions, and random selection in complete draws. \item\end{DoxyCompactList}\item 
\hypertarget{classIndividual_a642aa3144aeeac28afcb9e2073f18d2e}{
virtual void \hyperlink{classIndividual_a642aa3144aeeac28afcb9e2073f18d2e}{fromStream} (istream \&ist)}
\label{classIndividual_a642aa3144aeeac28afcb9e2073f18d2e}

\begin{DoxyCompactList}\small\item\em Replace contents with that read from an ASCII stream, for analysis or continuing a halted computation. \item\end{DoxyCompactList}\item 
virtual void \hyperlink{classIndividual_a66540af4b92fa807c557bb76c89d654c}{toStream} (ostream \&ost)
\begin{DoxyCompactList}\small\item\em Write content to an ASCII stream, for result output and computation tracing. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{classIndividual_a01b00ea4947684913020b88ea6968a5f}{impl\_\-from\_\-stream} (istream \&repr)=0
\begin{DoxyCompactList}\small\item\em \char`\"{}Crowding\char`\"{} value/dist. (e.g. NSGA-\/II) \item\end{DoxyCompactList}\item 
virtual void \hyperlink{classIndividual_a42739a633bc7263e4eadb5e745a82601}{impl\_\-to\_\-stream} (ostream \&repr)=0
\begin{DoxyCompactList}\small\item\em Write the actual (concrete) representation to a stream. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIndividual_aace8eddc9e3b2bab61d5d41913f1ebfb}{
int {\bfseries \_\-id}}
\label{classIndividual_aace8eddc9e3b2bab61d5d41913f1ebfb}

\item 
\hypertarget{classIndividual_a8d332536a1fa739ca29ff85ac7cb1ba5}{
int \hyperlink{classIndividual_a8d332536a1fa739ca29ff85ac7cb1ba5}{\_\-rank}}
\label{classIndividual_a8d332536a1fa739ca29ff85ac7cb1ba5}

\begin{DoxyCompactList}\small\item\em Running index or other ID tag. \item\end{DoxyCompactList}\item 
\hypertarget{classIndividual_a6de50bdf26d4c9f1330ab715cc8decac}{
vector$<$ double $>$ \hyperlink{classIndividual_a6de50bdf26d4c9f1330ab715cc8decac}{\_\-objectives}}
\label{classIndividual_a6de50bdf26d4c9f1330ab715cc8decac}

\begin{DoxyCompactList}\small\item\em Pareto rank within container pop. \item\end{DoxyCompactList}\item 
\hypertarget{classIndividual_a836740b5e55e9e46b75668fded7c4eb2}{
double \hyperlink{classIndividual_a836740b5e55e9e46b75668fded7c4eb2}{\_\-constraintViolation}}
\label{classIndividual_a836740b5e55e9e46b75668fded7c4eb2}

\begin{DoxyCompactList}\small\item\em Objective function values. \item\end{DoxyCompactList}\item 
\hypertarget{classIndividual_a1b330eac4fc663cfb379977f0f524cc2}{
double \hyperlink{classIndividual_a1b330eac4fc663cfb379977f0f524cc2}{\_\-crowding}}
\label{classIndividual_a1b330eac4fc663cfb379977f0f524cc2}

\begin{DoxyCompactList}\small\item\em Constraint violation. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Friends}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIndividual_aff20009b84898d28661a282b69a2be8c}{
int \hyperlink{classIndividual_aff20009b84898d28661a282b69a2be8c}{checkDominance} (const \hyperlink{classIndividual}{Individual} \&ind1, const \hyperlink{classIndividual}{Individual} \&ind2)}
\label{classIndividual_aff20009b84898d28661a282b69a2be8c}

\begin{DoxyCompactList}\small\item\em Dominance comparison operation as in NSGA-\/II; returns 1 if ind1 dominates, -\/1 if ind2 dominates, and 0 upon mutual non-\/domination. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Base class for the individuals in a Pareto optimization population. Must be derived for concrete objective computations. This base class is an abstraction layer that does not care about internal representation or how to compute anything. Rather, this implements only the facilities for Pareto dominance handling and storage in the evolving population and in the total solution archive. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classIndividual_a375e27b7b7cac8008991b690e7967a0f}{
\index{Individual@{Individual}!Individual@{Individual}}
\index{Individual@{Individual}!Individual@{Individual}}
\subsubsection[{Individual}]{\setlength{\rightskip}{0pt plus 5cm}Individual::Individual ()\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classIndividual_a375e27b7b7cac8008991b690e7967a0f}


Create uninitialized; only for reading from stream very soon. \hypertarget{classIndividual_af44020c83a517658392839205b3f5479}{
\index{Individual@{Individual}!Individual@{Individual}}
\index{Individual@{Individual}!Individual@{Individual}}
\subsubsection[{Individual}]{\setlength{\rightskip}{0pt plus 5cm}Individual::Individual (size\_\-t {\em numObjectives})}}
\label{classIndividual_af44020c83a517658392839205b3f5479}


Create and initialize; should call this from derived constructor. 

\subsection{Member Function Documentation}
\hypertarget{classIndividual_aa4b376475c4078ed8decc17c16f26c1b}{
\index{Individual@{Individual}!crossWith@{crossWith}}
\index{crossWith@{crossWith}!Individual@{Individual}}
\subsubsection[{crossWith}]{\setlength{\rightskip}{0pt plus 5cm}virtual pair$<$unique\_\-ptr$<${\bf Individual}$>$,unique\_\-ptr$<${\bf Individual}$>$ $>$ Individual::crossWith ({\bf Individual} \& {\em other})\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classIndividual_aa4b376475c4078ed8decc17c16f26c1b}


Binary cross-\/over with another individual. Up to the concrete class. 

Implemented in \hyperlink{classMlpIndividual_ade3d70759707bf08b73b0343b76d163f}{MlpIndividual}.\hypertarget{classIndividual_a4bc4ae3cc82bcb6e27600f597fe0136b}{
\index{Individual@{Individual}!evaluate@{evaluate}}
\index{evaluate@{evaluate}!Individual@{Individual}}
\subsubsection[{evaluate}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Individual::evaluate ()\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classIndividual_a4bc4ae3cc82bcb6e27600f597fe0136b}


Evaluate objective functions. Is to be called before getting values, if any operators have been applied. The concrete derived class must assign objective values when this is called. 

Implemented in \hyperlink{classMlpIndividual_a95b8875bf88fc97a677ef508800ea865}{MlpIndividual}.\hypertarget{classIndividual_a96eba94e7973e8f55588bd7cb8dc2be9}{
\index{Individual@{Individual}!getTrace@{getTrace}}
\index{getTrace@{getTrace}!Individual@{Individual}}
\subsubsection[{getTrace}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ double $>$ Individual::getTrace ()\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIndividual_a96eba94e7973e8f55588bd7cb8dc2be9}


Get measures that are interesting in post-\/run tracing; subclasses would know which measures are of importance. By default, the objectives are returned as a vector object. 

Reimplemented in \hyperlink{classMlpIndividual_a2c1bd84977f2ffaa5007c4bfb7260884}{MlpIndividual}.\hypertarget{classIndividual_a01b00ea4947684913020b88ea6968a5f}{
\index{Individual@{Individual}!impl\_\-from\_\-stream@{impl\_\-from\_\-stream}}
\index{impl\_\-from\_\-stream@{impl\_\-from\_\-stream}!Individual@{Individual}}
\subsubsection[{impl\_\-from\_\-stream}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Individual::impl\_\-from\_\-stream (istream \& {\em repr})\hspace{0.3cm}{\ttfamily  \mbox{[}protected, pure virtual\mbox{]}}}}
\label{classIndividual_a01b00ea4947684913020b88ea6968a5f}


\char`\"{}Crowding\char`\"{} value/dist. (e.g. NSGA-\/II) Read the actual (concrete) representation from a stream. 

Implemented in \hyperlink{classMlpIndividual_a181ddd5722642d66aecad14bf104d56e}{MlpIndividual}.\hypertarget{classIndividual_a42739a633bc7263e4eadb5e745a82601}{
\index{Individual@{Individual}!impl\_\-to\_\-stream@{impl\_\-to\_\-stream}}
\index{impl\_\-to\_\-stream@{impl\_\-to\_\-stream}!Individual@{Individual}}
\subsubsection[{impl\_\-to\_\-stream}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Individual::impl\_\-to\_\-stream (ostream \& {\em repr})\hspace{0.3cm}{\ttfamily  \mbox{[}protected, pure virtual\mbox{]}}}}
\label{classIndividual_a42739a633bc7263e4eadb5e745a82601}


Write the actual (concrete) representation to a stream. 

Implemented in \hyperlink{classMlpIndividual_a49700637b4237b4bca3d2d3671c7cc78}{MlpIndividual}.\hypertarget{classIndividual_ad56de759959b719e51873c1cabe574a1}{
\index{Individual@{Individual}!improve@{improve}}
\index{improve@{improve}!Individual@{Individual}}
\subsubsection[{improve}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Individual::improve (mt19937 $\ast$ {\em mt})\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classIndividual_ad56de759959b719e51873c1cabe574a1}


Apply memetic improvement operator(s). Up to the concrete class. 

Implemented in \hyperlink{classMlpIndividual_a93e5b36d6afa83f533363df0716284fc}{MlpIndividual}.\hypertarget{classIndividual_aa86bbece0507640edb4f4b2714a162f4}{
\index{Individual@{Individual}!mutate@{mutate}}
\index{mutate@{mutate}!Individual@{Individual}}
\subsubsection[{mutate}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Individual::mutate ()\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{classIndividual_aa86bbece0507640edb4f4b2714a162f4}


Apply evolutionary mutation operator(s). Up to the concrete class. 

Implemented in \hyperlink{classMlpIndividual_a34479f041ffc11ae5ef2c580205177c6}{MlpIndividual}.\hypertarget{classIndividual_a66540af4b92fa807c557bb76c89d654c}{
\index{Individual@{Individual}!toStream@{toStream}}
\index{toStream@{toStream}!Individual@{Individual}}
\subsubsection[{toStream}]{\setlength{\rightskip}{0pt plus 5cm}void Individual::toStream (ostream \& {\em ost})\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIndividual_a66540af4b92fa807c557bb76c89d654c}


Write content to an ASCII stream, for result output and computation tracing. \hypertarget{classIndividual_a29508de0e315c8cf19e659d2b01bc9ab}{
\index{Individual@{Individual}!winsTournamentAgainst@{winsTournamentAgainst}}
\index{winsTournamentAgainst@{winsTournamentAgainst}!Individual@{Individual}}
\subsubsection[{winsTournamentAgainst}]{\setlength{\rightskip}{0pt plus 5cm}bool Individual::winsTournamentAgainst (const {\bf Individual} \& {\em opponent}, \/  mt19937 $\ast$ {\em mt})\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIndividual_a29508de0e315c8cf19e659d2b01bc9ab}


Returns true if this individual is better than another in the NSGA-\/II -\/sense, i.e., based on dominance, crowding distance within non-\/dominated solutions, and random selection in complete draws. Needs the source for random numbers to make the draw. 

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