\section{Ki\-Track\-:\-:Subset\-Hopfield\-N\-N$<$ T $>$ Class Template Reference}
\label{classKiTrack_1_1SubsetHopfieldNN}\index{Ki\-Track\-::\-Subset\-Hopfield\-N\-N$<$ T $>$@{Ki\-Track\-::\-Subset\-Hopfield\-N\-N$<$ T $>$}}


A class to get the best subset with help of a Hopfield Neural Network.  




{\ttfamily \#include $<$Subset\-Hopfield\-N\-N.\-h$>$}

Inheritance diagram for Ki\-Track\-:\-:Subset\-Hopfield\-N\-N$<$ T $>$\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classKiTrack_1_1SubsetHopfieldNN}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$class Get\-Q\-I , class Are\-Compatible $>$ }\\void {\bf calculate\-Best\-Set} (Are\-Compatible are\-Compatible, Get\-Q\-I get\-Q\-I)
\begin{DoxyCompactList}\small\item\em Calculates the best set using a Hopfield Neural Network (see {\tt this} for more info) . \end{DoxyCompactList}\item 
void {\bfseries set\-T\-Start} (double t\-Start)\label{classKiTrack_1_1SubsetHopfieldNN_ac9d2165eae48c724a9e51da30583d42d}

\item 
void {\bfseries set\-T\-Inf} (double t\-Inf)\label{classKiTrack_1_1SubsetHopfieldNN_ac151e20baa022ca423c60ff740fad089}

\item 
void {\bfseries set\-Omega} (double omega)\label{classKiTrack_1_1SubsetHopfieldNN_ac094f3ab2c1a2597541d41fbfc1b8fa1}

\item 
void {\bfseries set\-Limit\-For\-Stable} (double limit\-For\-Stable)\label{classKiTrack_1_1SubsetHopfieldNN_aca4de3fa5bd746f17a7bb11558201607}

\item 
void {\bfseries set\-Init\-State\-Min} (double init\-State\-Min)\label{classKiTrack_1_1SubsetHopfieldNN_a2fd220b5ff0c7062a7a3c37c37590a0c}

\item 
void {\bfseries set\-Init\-State\-Max} (double init\-State\-Max)\label{classKiTrack_1_1SubsetHopfieldNN_a17f0465437ddbb978714699170ab2ff3}

\item 
void {\bfseries set\-Activation\-Threshold} (double activation\-Threshold)\label{classKiTrack_1_1SubsetHopfieldNN_ad140c685c37674cffc7bc883ae5494f2}

\item 
double {\bfseries get\-T\-Start} ()\label{classKiTrack_1_1SubsetHopfieldNN_ada7b81e3d92af934a7424bd593ba2d38}

\item 
double {\bfseries get\-T\-Inf} ()\label{classKiTrack_1_1SubsetHopfieldNN_aa1c099acd4ef47b702e3d38750a0c56c}

\item 
double {\bfseries get\-Omega} ()\label{classKiTrack_1_1SubsetHopfieldNN_ac69cc82605d848cadfd8e1ad29f8b6f7}

\item 
double {\bfseries get\-Limit\-For\-Stable} ()\label{classKiTrack_1_1SubsetHopfieldNN_a9317dde3b667c3374de8194388904e8c}

\item 
double {\bfseries get\-Init\-State\-Min} ()\label{classKiTrack_1_1SubsetHopfieldNN_af0c02896b260c0d91d7142dc1154c4d8}

\item 
double {\bfseries get\-Init\-State\-Max} ()\label{classKiTrack_1_1SubsetHopfieldNN_a2aed9d2438d6cadfcf504811642a79be}

\item 
double {\bfseries get\-Activation\-Threshold} ()\label{classKiTrack_1_1SubsetHopfieldNN_a50ab395f5585a75688d286535eb66b94}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
double {\bfseries \-\_\-\-T\-Start}\label{classKiTrack_1_1SubsetHopfieldNN_a2793af883a4527a6b9252643c11964c3}

\item 
double {\bfseries \-\_\-\-T\-Inf}\label{classKiTrack_1_1SubsetHopfieldNN_ad4f06d880942c742abbb909df1fad23b}

\item 
double {\bfseries \-\_\-omega}\label{classKiTrack_1_1SubsetHopfieldNN_a5ce58c3d845f5d418c2c884908b6ac77}

\item 
double {\bfseries \-\_\-limit\-For\-Stable}\label{classKiTrack_1_1SubsetHopfieldNN_a9d78aa1aa2dde53bc88b5da4c1a63972}

\item 
double {\bfseries \-\_\-init\-State\-Min}\label{classKiTrack_1_1SubsetHopfieldNN_a5172f3208c8dc22f8d9bd711b23e2faf}

\item 
double {\bfseries \-\_\-init\-State\-Max}\label{classKiTrack_1_1SubsetHopfieldNN_afe16a6f0b05f8c4dbe940c0ed21cc2f3}

\item 
double {\bfseries \-\_\-activation\-Threshold}\label{classKiTrack_1_1SubsetHopfieldNN_ad794d47445c5824eb3fbb90a64d623da}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class T$>$class Ki\-Track\-::\-Subset\-Hopfield\-N\-N$<$ T $>$}

A class to get the best subset with help of a Hopfield Neural Network. 



\subsection{Member Function Documentation}
\index{Ki\-Track\-::\-Subset\-Hopfield\-N\-N@{Ki\-Track\-::\-Subset\-Hopfield\-N\-N}!calculate\-Best\-Set@{calculate\-Best\-Set}}
\index{calculate\-Best\-Set@{calculate\-Best\-Set}!KiTrack::SubsetHopfieldNN@{Ki\-Track\-::\-Subset\-Hopfield\-N\-N}}
\subsubsection[{calculate\-Best\-Set}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ template$<$class Get\-Q\-I , class Are\-Compatible $>$ void {\bf Ki\-Track\-::\-Subset\-Hopfield\-N\-N}$<$ T $>$\-::calculate\-Best\-Set (
\begin{DoxyParamCaption}
\item[{Are\-Compatible}]{are\-Compatible, }
\item[{Get\-Q\-I}]{get\-Q\-I}
\end{DoxyParamCaption}
)}\label{classKiTrack_1_1SubsetHopfieldNN_a493a15d48127f66069d33f31b861a4ab}


Calculates the best set using a Hopfield Neural Network (see {\tt this} for more info) . 

After this the results can be accessed with the \doxyref{get\-Accepted()}{p.}{classKiTrack_1_1Subset_a185d85f923c6705cf91b047a01e7af6b} and \doxyref{get\-Rejected()}{p.}{classKiTrack_1_1Subset_a6c68e5197ba52b2f4bcc2dc0fed57e0c} methods (provided by the baseclass \doxyref{Subset}{p.}{classKiTrack_1_1Subset}).

\begin{DoxyVerb}     This is a templated class to allow the reuse with objects from different.
     The goal is this: if you have a set of things that are somehow compatible or incompatible 
     with each other and you want a subset that only contains compatible ones and has a high quality, to find
     this subset.

     For example: you plan a concert where a lot of different artists shall perform together. You have 20 that
     you are interested in asking. BUT: not all of them get along together very well. So artist 1 might be incompatible
     with artist 2 and 7 for some arbitrary reasons. And artist 2 is incompatible with artist 1,3 and 13 and so on.
     In order not to completely mess up the concert you can only invite artists who are entirely compatible with each other.
     AND: not all artists are equal: some are really famous and some are pretty mediocre.
     So you want to find a set of artists with the highest possible quality which is completely compatible.

     This is done by this class. The algorithm used for it is a Hopfield Neural Network (HNN).

     In order to work it needs to know two things: how to calculate the quality of an element and how to determine
     if two elements are compatible. These are of course things the user has to provide.
     For both a functor object is needed.

     Here is how it could look like in the artist example:
\end{DoxyVerb}


\begin{DoxyVerb}class AristQI{
  
   public:
 
   // returns the quality of an artist (a value between 0 and 1, 0 being bad and 1 being fantastic)  
   inline double operator()( Artist artist ){
   
      return artist.numberOfFans()/nPeopleOnEarth;    // a number between 0 and 1
      
  }

};

class ArtistCompatibility{

public:

   // returns whether two artists are compatible
   inline bool operator()( Artist artistA, Artist artistB ){
   
      if( artistA.hates( artistB ) ) return false;
      else return true; 
     
   }

};


//Somewhere within the program:

ArtistCompatibility comp;
ArtistQI qi;

SubsetHopfieldNN< Artist > subset;
subset.add( vecOfArtists );                                 
subset.calculateBestSet( comp, qi );

std::vector< Artist > artistsToInvite = subset.getAccepted();
std::vector< Artist > artistsToStayAtHome = subset.getRejected();\end{DoxyVerb}


\begin{DoxyVerb}     @param areCompatible a functor of type bool( T, T ) that should tell whether two elements are compatible
     or not.

     @param getQI a functor of type double( T ) that returns the quality of an element and should range between 0 and 1.\end{DoxyVerb}
 

References Ki\-Track\-::\-Hopfield\-Neural\-Net\-::do\-Iteration(), Ki\-Track\-::\-Hopfield\-Neural\-Net\-::get\-States(), Ki\-Track\-::\-Hopfield\-Neural\-Net\-::set\-Limit\-For\-Stable(), Ki\-Track\-::\-Hopfield\-Neural\-Net\-::set\-T(), and Ki\-Track\-::\-Hopfield\-Neural\-Net\-::set\-T\-Inf().



The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Subset\-Hopfield\-N\-N.\-h\end{DoxyCompactItemize}
