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:
integer constraints

Subject: integer constraints

From: jem

Date: 20 Jan, 2011 07:28:04

Message: 1 of 3

All,

I have a function 'total_loss = get_system_loss(cap,invbus,rectbus)' which i want to minimize using GA. The input parameters should be integers. How do i constraint GA such that the population is composed of integers only?

Thanks.

jem

Subject: integer constraints

From: Steve

Date: 20 Jan, 2011 16:00:23

Message: 2 of 3

"jem " <jeramymendoza@gmail.com> wrote in message <ih8o64$sjj$1@fred.mathworks.com>...
> All,
>
> I have a function 'total_loss = get_system_loss(cap,invbus,rectbus)' which i want to minimize using GA. The input parameters should be integers. How do i constraint GA such that the population is composed of integers only?
>
> Thanks.
>
> jem

Check out this solution for an example of integer programming with ga:
http://www.mathworks.com/support/solutions/en/data/1-10PDHC/

As for crossover functions, several of the built-in crossover functions maintain integer entries. The following maintain integers:
Scattered (@crossoverscattered), the default crossover function
Single point (@crossoversinglepoint)
Two point (@crossovertwopoint)

See for more detail:
http://www.mathworks.com/access/helpdesk/help/toolbox/gads/f6174dfi10.html#f7820

Additionally, you could write your own crossover function using the syntax in the
section I just referenced. Just make sure that the resulting vectors are integers if the input vectors are.

Good luck,
+Steve

Subject: integer constraints

From: jem

Date: 21 Jan, 2011 19:27:06

Message: 3 of 3

"Steve" <steve.grikschat@mathworks.com> wrote in message <ih9m6n$n0$1@fred.mathworks.com>...
> "jem " <jeramymendoza@gmail.com> wrote in message <ih8o64$sjj$1@fred.mathworks.com>...
> > All,
> >
> > I have a function 'total_loss = get_system_loss(cap,invbus,rectbus)' which i want to minimize using GA. The input parameters should be integers. How do i constraint GA such that the population is composed of integers only?
> >
> > Thanks.
> >
> > jem
>
> Check out this solution for an example of integer programming with ga:
> http://www.mathworks.com/support/solutions/en/data/1-10PDHC/
>
> As for crossover functions, several of the built-in crossover functions maintain integer entries. The following maintain integers:
> Scattered (@crossoverscattered), the default crossover function
> Single point (@crossoversinglepoint)
> Two point (@crossovertwopoint)
>
> See for more detail:
> http://www.mathworks.com/access/helpdesk/help/toolbox/gads/f6174dfi10.html#f7820
>
> Additionally, you could write your own crossover function using the syntax in the
> section I just referenced. Just make sure that the resulting vectors are integers if the input vectors are.
>
> Good luck,
> +Steve


Steve,

The links were really helpful. I was able to optimize a test function with the gainteger_demo.m file . However, I forgot to mention that I can't have zeroes on my population as well. Any suggestions as to how I can modify the functions?

Thanks a lot.

Jem

Tags for 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