Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: how to custom in order to use "gamultiobj" toolbox to do integer optimization?

$
0
0


"guymcheers " <guymcheers@gmail.com> wrote in message
news:kufo78$m3t$1@newscl01ah.mathworks.com...
> (Updated)Currently, I meet a problem that I want to use the toolbox of
> "gamultiobj" to solve my problem. However, till matlab 2013a, it cannot
> solve the integer optimization with this problem. (ga toolbox can handle
> integer optimization already)
>
> Someone said it can be solved by custom the following:
>
> (http://www.mathworks.com/matlabcentral/newsreader/view_thread/278131)
>
> (1) Creation function (2)Mutation function (3)Crossover function (4) input
> data type.
> There is a demo can tell us how to custom the (1) and (2).
> (http://www.mathworks.com/support/solutions/en/data/1-10PDHC/)
>
> I have followed this demo, however, there is still a error:
> "??? Error using ==> gamultiobj at 224
> GAMULTIOBJ only accepts inputs of data type double."
>
> who can help me that what should I do? how to custom the data type to
> "integer"?

There's a difference between integer _data types_ and integer _values_ -- I
suspect that by using custom creation, mutation, and crossover functions you
can support the latter but not the former.

x = int8(5)
y = 5

x is a variable of an integer data type (specifically signed 8-bit integer)
and it contains an integer value. From the error message you posted it
appears GAMULTOBJ will NOT support using a creation etc. function that
returns something like x.

y is a variable that is NOT of an integer data type (it is a double
precision variable) but it does contain an integer value. GAMULTOBJ should
support using a creation etc. function that returns something like y.

You will want your custom creation, mutation, and crossover functions to
return only variables of the double precision data type that contain integer
values. Cleve refers to these as "flints", floating-point integers, on page
3 of the floating-point Cleve's Corner article linked in the newsgroup FAQ.

http://www.mathworks.com/company/newsletters/news_notes/pdf/Fall96Cleve.pdf

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Viewing all articles
Browse latest Browse all 19628

Trending Articles