30318e94e0b3ba62188da2aab9ebac3a8eaacd76
[scilab.git] / scilab / modules / simulated_annealing / help / en_US / utilities / temp_law_fsa.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com>
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="temp_law_fsa" xml:lang="en">
17     <refnamediv>
18         <refname>temp_law_fsa</refname>
19         <refpurpose>The Szu and Hartley Fast simulated annealing</refpurpose>
20     </refnamediv>
21     <refsynopsisdiv>
22         <title>Syntax</title>
23         <synopsis>T_out = temp_law_fsa(T_in,step_mean,step_var,temp_stage,n,param)</synopsis>
24     </refsynopsisdiv>
25     <refsection>
26         <title>Arguments</title>
27         <variablelist>
28             <varlistentry>
29                 <term>T_in</term>
30                 <listitem>
31                     <para>the temperature at the current stage</para>
32                 </listitem>
33             </varlistentry>
34             <varlistentry>
35                 <term>step_mean</term>
36                 <listitem>
37                     <para>the mean value of the objective function computed during the
38                         current stage
39                     </para>
40                 </listitem>
41             </varlistentry>
42             <varlistentry>
43                 <term>step_var</term>
44                 <listitem>
45                     <para>the variance value of the objective function computed during
46                         the current stage
47                     </para>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>temp_stage</term>
52                 <listitem>
53                     <para>the index of the current temperature stage</para>
54                 </listitem>
55             </varlistentry>
56             <varlistentry>
57                 <term>n</term>
58                 <listitem>
59                     <para>the dimension of the decision variable (the x in f(x))</para>
60                 </listitem>
61             </varlistentry>
62             <varlistentry>
63                 <term>param</term>
64                 <listitem>
65                     <para>not used for this temperature law</para>
66                 </listitem>
67             </varlistentry>
68             <varlistentry>
69                 <term>T_out</term>
70                 <listitem>
71                     <para>the temperature for the temperature stage to come</para>
72                 </listitem>
73             </varlistentry>
74         </variablelist>
75     </refsection>
76     <refsection>
77         <title>Description</title>
78         <itemizedlist>
79             <listitem>
80                 <para>This function implements the Fast simulated annealing of Szu and
81                     Hartley.
82                 </para>
83             </listitem>
84         </itemizedlist>
85     </refsection>
86     <refsection>
87         <title>Examples</title>
88         <programlisting role="example"><![CDATA[
89 function y = rastrigin(x)
90   y = x(1)^2+x(2)^2-cos(12*x(1))-cos(18*x(2));
91 endfunction
92
93 x0 = [-1, -1];
94 Proba_start = 0.8;
95 It_intern = 1000;
96 It_extern = 30;
97 It_Pre    = 100;
98
99 mprintf('SA: the FSA algorithm\n');
100
101 T0 = compute_initial_temp(x0, rastrigin, Proba_start, It_Pre, neigh_func_default);
102 mprintf('Initial temperature T0 = %f\n', T0);
103
104 [x_opt, f_opt, sa_mean_list, sa_var_list, temp_list] = optim_sa(x0, rastrigin, It_extern, It_intern, T0, Log = %T, temp_law_fsa, neigh_func_fsa);
105
106 mprintf('optimal solution:\n'); disp(x_opt);
107 mprintf('value of the objective function = %f\n', f_opt);
108
109 scf();
110 subplot(2,1,1);
111 xtitle('Fast simulated annealing','Iteration','Mean / Variance');
112 t = 1:length(sa_mean_list);
113 plot(t,sa_mean_list,'r',t,sa_var_list,'g');
114 legend(['Mean','Variance']);
115 subplot(2,1,2);
116 xtitle('Temperature evolution','Iteration','Temperature');
117 plot(t,temp_list,'k-');
118  ]]></programlisting>
119     </refsection>
120     <refsection role="see also">
121         <title>See Also</title>
122         <simplelist type="inline">
123             <member>
124                 <link linkend="optim_sa"> optim_sa </link>
125             </member>
126             <member>
127                 <link linkend="temp_law_huang"> temp_law_huang </link>
128             </member>
129             <member>
130                 <link linkend="neigh_func_default"> neigh_func_default
131                 </link>
132             </member>
133         </simplelist>
134     </refsection>
135 </refentry>