Random Sampling

Description

Random Sampling is an algorithm which, simply, randomly creates a new candidate solution, usually by uniformly sampling the search space. (uniform sampling means that each possible genotype has the same probability of being chosen)

Definitions

$$f \gets \text{the objective/fitness function}$$ $$terminationCriteria \gets \text{the termination criterion}$$ $$x \gets \text{the new solution}$$ $$\textit{Best} \gets \text{the best individual ever discovered}$$

References

Thomas Weise - Metaheuristic Optimization

Pseudo Code
\begin{algorithm}
\caption{RS Algorithm}
\begin{algorithmic}
                \STATE $\textit{Best} \gets Null$
                \WHILE{$terminationCriteria$}
                    \STATE $x \gets random()$
                    \IF{$f(\textit{Best}) \geq f(x)$ or $\textit{Best} == Null$}
                        \STATE $\textit{Best} \gets x$
                    \ENDIF
                \ENDWHILE
                \RETURN $\textit{Best}$
\end{algorithmic}
\end{algorithm}