next up previous contents
Next: Quickly Adding a Problem Up: Optimization from Matlab Previous: Optimization Options   Contents

Usage Example

Listing 1 shows an exemplary m-File that could be used as target function in an optimization through Matlab. Notice that the paramter y might be used in any other way or not used at all. EVA2 will not introspect the contents of y, but just hand it over to every call to the target function where it may be assumed static. So to optimize the Himmelblau function using Particle Swarm Optimization, proceed in the Matlab console as shown in Listing 2. For a binary optimization, you might set R=50, for example, the target function will then receive 2 uint32's of which 50 bits are to be used in the target function.


\begin{algorithm}
% latex2html id marker 506\begin{mylstenv}
javaaddpath '/hom...
...sole, integer example with specific
initialization range.
}
\par
\end{algorithm}


\begin{algorithm}
% latex2html id marker 511\begin{mylstenv}
javaaddpath '/hom...
...ion{Optimization from the Matlab console, binary example.
}
\par
\end{algorithm}


\begin{algorithm}
% latex2html id marker 516\begin{mylstenv}
javaaddpath '/hom...
...ptimization from the Matlab console, real-valued example.
}
\par
\end{algorithm}



Marcel Kronfeld 2011-05-05