Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to define my GA optimization problem only once ? and how to display more variables ?

Subject: how to define my GA optimization problem only once ? and how to display more variables ?

From: Mamdouh

Date: 22 Jan, 2014 01:28:11

Message: 1 of 2

Hello,
I have some integer variables, so I almost forced to use GA although I have nonlinear constrains, three objective functions, and many hundreds of variables ...
anyway
I combined the three objective functions in one objective function by multiplying each one by a certain weighting parameter ranging from 0 to 1.0
I built up my code in one .m file (containing the fitness function, the constrain function, and the GA function)
my two questions are:
1- I repeated the problem settings and constants in all these three functions, so my code became long, how can I define them only once ?
2- I wanna know the final value of all the three objective functions as well as some other variables in order to compare results, how can I do that ?

I am not sure if my thread is clear enough,
if you wanna help and couldn't follow my thread, kindly ask me for clarification,
thanks in advance,
Kind Regards
Mamdouh

Subject: how to define my GA optimization problem only once ? and how

From: Alan_Weiss

Date: 22 Jan, 2014 18:09:49

Message: 2 of 2

On 1/21/2014 8:28 PM, Mamdouh wrote:
> Hello,
> I have some integer variables, so I almost forced to use GA although I
> have nonlinear constrains, three objective functions, and many
> hundreds of variables ...
> anyway
> I combined the three objective functions in one objective function by
> multiplying each one by a certain weighting parameter ranging from 0
> to 1.0
> I built up my code in one .m file (containing the fitness function,
> the constrain function, and the GA function)
> my two questions are:
> 1- I repeated the problem settings and constants in all these three
> functions, so my code became long, how can I define them only once ?
> 2- I wanna know the final value of all the three objective functions
> as well as some other variables in order to compare results, how can I
> do that ?
>
> I am not sure if my thread is clear enough,
> if you wanna help and couldn't follow my thread, kindly ask me for
> clarification,
> thanks in advance,
> Kind Regards Mamdouh
I answered this on MATLAB Answers:
http://www.mathworks.com/matlabcentral/answers/113326-in-ga-how-can-i-define-my-problem-constants-once-and-how-can-i-know-the-final-values-of-the-ot

Alan Weiss
MATLAB mathematical toolbox documentation

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us