Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - 日本語

Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
See the recommended documentation of this function

Aide Scilab >> Simulated Annealing > neigh_func_default

neigh_func_default

A SA function which computes a neighbor of a given point

Calling Sequence

x_neigh = neigh_func_default(x_current,T)
x_neigh = neigh_func_default(x_current,T,param)

Arguments

x_current

the point for which we want to compute a neighbor

T

the current temperature. This parameter is ignored but is there to make all the neighbour function consistent.

param

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.

x_neigh

the computed neighbor

Description

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.

Examples

function y=rastrigin(x)
  y = x(1)^2+x(2)^2-cos(12*x(1))-cos(18*x(2));
endfunction
    
x0          = [2 2];
Proba_start = 0.7;
It_Pre      = 100;
It_extern   = 100;
It_intern   = 1000;
x_test = neigh_func_default(x0,%nan);

saparams = init_param();
saparams = add_param(comp_t_params,'neigh_func', neigh_func_default);

T0 = compute_initial_temp(x0, rastrigin, Proba_start, It_Pre, saparams);
Log = %T;
[x_opt, f_opt, sa_mean_list, sa_var_list] = optim_sa(x0, rastrigin, It_extern, It_intern, T0, Log,saparams);

printf('optimal solution:\n'); disp(x_opt);
printf('value of the objective function = %f\n', f_opt);

See Also

  • optim_sa — A Simulated Annealing optimization method
  • compute_initial_temp — A SA function which allows to compute the initial temperature of the simulated annealing
  • temp_law_default — A SA function which computed the temperature of the next temperature stage

Authors

Yann Collette - 2008 - ycollet@freesurf.fr

Michael Baudin - Digiteo - 2010

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Oct 05 12:11:00 CEST 2011