<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154935</link>
    <title>MATLAB Central Newsreader - Genetic Algorithm and working with discrete variables</title>
    <description>Feed for thread: Genetic Algorithm and working with discrete variables</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 22 Aug 2007 12:14:52 -0400</pubDate>
      <title>Genetic Algorithm and working with discrete variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154935#388730</link>
      <author>Mohammad </author>
      <description>hello&lt;br&gt;
How can I do in the GAtool (genetic algorithm toolbox) if &lt;br&gt;
my variables are allowed to select from a set of special &lt;br&gt;
discrete values? because it works with continuous ranges of &lt;br&gt;
values. thanks. good luck</description>
    </item>
    <item>
      <pubDate>Wed, 22 Aug 2007 14:58:20 -0400</pubDate>
      <title>Re: Genetic Algorithm and working with discrete variables</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154935#388765</link>
      <author>Thomas Clark</author>
      <description>&quot;Mohammad &quot; &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fah9bs$lne$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; hello&lt;br&gt;
&amp;gt; How can I do in the GAtool (genetic algorithm toolbox) if &lt;br&gt;
&amp;gt; my variables are allowed to select from a set of special &lt;br&gt;
&amp;gt; discrete values? because it works with continuous ranges of &lt;br&gt;
&amp;gt; values. thanks. good luck&lt;br&gt;
&lt;br&gt;
I've not done it; but suggest that you get the mutation&lt;br&gt;
function to optimise over a bounded continuous range; (say&lt;br&gt;
0.5 to 8.5). &lt;br&gt;
&lt;br&gt;
In this case, you would have 8 discrete variables. Round the&lt;br&gt;
output of the mutation function - you get 1,2,3,4,5,6,7 or&lt;br&gt;
8. Use the output to index into your discrete variable.&lt;br&gt;
&lt;br&gt;
If you need to assign a continuous desirability function,&lt;br&gt;
then do this:&lt;br&gt;
&lt;br&gt;
x = [0.5 1 2 3 4 5 6 7 8 8.5];&lt;br&gt;
y = [0 s1 s2 s3 s4 s5 s6 s7 s8 0]; &lt;br&gt;
% where sx is the score of &lt;br&gt;
% the corresponding discrete variable&lt;br&gt;
pp = pchip(x,y); &lt;br&gt;
% don't use spline, or it'll &lt;br&gt;
% oscillate like mad&lt;br&gt;
&lt;br&gt;
% then access the desirability &lt;br&gt;
% score using:&lt;br&gt;
yi = ppval(xi);&lt;br&gt;
&lt;br&gt;
Just a few ideas- hope it helps :)&lt;br&gt;
&lt;br&gt;
Tom</description>
    </item>
  </channel>
</rss>

