real coded genetic algorithm

i have found the objective function.i don't know how to use objective fun in real coded genetic algo in matlab code (or) in matlab toolbox

5 件のコメント

Geoff Hayes
Geoff Hayes 2014 年 9 月 26 日
vetri - is your objective function is the function that you wish to minimize (and so will be the fitness function of the GA)?
vetri
vetri 2014 年 9 月 28 日
no.i have to maximize the objective function
Geoff Hayes
Geoff Hayes 2014 年 9 月 28 日
Ok, so you will have to change (slightly) your objective function so that the problem becomes a minimization one. If you are going to use the genetic algorithm functionality from the Global Optimization Toolbox, you will be using ga and so the signature of your objective/fitness function will be such that it should accept a row vector of length nvars and return a scalar value. So something like
function [result] = myFitnessFunc(inputVars)
where inputVars is a 1xnvars array (with nvars being the number of variables) and * result* is the scalar result. Those solutions that produce smaller results will be considered "more fit" and so more likely chosen for selection as parents to the next generation/iteration of the algorithm.
vetri
vetri 2014 年 9 月 29 日
how to change objective function..but in my project the objective fun should be maximized.
dada khalendar
dada khalendar 2016 年 2 月 20 日
can i see your program code ?

サインインしてコメントする。

回答 (1 件)

Alan Weiss
Alan Weiss 2014 年 9 月 29 日

0 投票

The documentation shows how to maximize instead of minimize. Basically, just take the negative of your objective function.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

質問済み:

2014 年 9 月 26 日

コメント済み:

2016 年 2 月 20 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by