neigh_func_default — A SA function which computes a neighbor of a given point
x_neigh = neigh_func_default(x_current,T,param)
the point for which we want to compute a neighbor
the current temperature
a two columns vector. The first column correspond to the negative amplitude of variation and the second column corresponds to the positive amplitude of variation of the neighborhood. By default, the first column is a column of -0.1 and the second column is a column of 0.1.
the computed neighbor
This function computes a neighbor of a given point. For example, for a continuous vector, a neighbor will be produced by adding some noise to each component of the vector. For a binary string, a neighbor will be produced by changing one bit from 0 to 1 or from 1 to 0.
// We produce a neighbor by adding some noise to each component of a given vector function x_neigh = neigh_func_default(x_current, T) sa_min_delta = -0.1*ones(size(x_current,1),size(x_current,2)); sa_max_delta = 0.1*ones(size(x_current,1),size(x_current,2)); x_neigh = x_current + (sa_max_delta - sa_min_delta).*rand(size(x_current,1),size(x_current,2)) + sa_min_delta; endfunction