passing multidimensional parameters in objective function

Markku Laukkanen markku at ailabsolutions.com
Tue Aug 27 03:26:30 EDT 2002


On Tue, 27 Aug 2002, Samuel Danthine wrote:

> Hi,
> I am using GAlib and trying to pass a bunch of multi-dimensional arrays 
> into the objective function. With the user.Data this does not work (might 
> be possible to pass all the parameters as a an array and reorder them...)
> If there is any way to do this, I am more than happy to hear it!

Hmm, all of the genome share the same userData object, so if you want to
give the objective function more than one multi-dimensional array, you
have to back the arrays into some container -->

class Container {
	int* myArrays;
	}

and in the calling end

e.g. GA1DarrayGenome<int> genome(100, objectiveFunc);

Container cont = new Container();

genome.userData(cont);

Hope this helps,
	PKY


> 
> Thanks
> 
> Sam
> 
> ******************************************************************************** 
> 
> Samuel Danthine
> Department of Economics
> University of Rochester
> 238 Harkness Hall
> Rochester, NY 14627
> 
> Phone:(585) 275 5287
> Fax: (585) 256 2309
> E-mail: samd at troi.cc.rochester.edu
> Homepage: http://troi.cc.rochester.edu/~samd
> ---------------------------------------------------------------------------------------------------
> 




More information about the galib mailing list