ECJ-INTEREST-L Archives

December 2016

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Eric 'Siggy' Scott <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Wed, 28 Dec 2016 19:54:09 -0500
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (1387 bytes) , text/html (2956 bytes)
Enzo,

Were you able to solve your problem?  Or could you still use assistance?

The usual way to access information in another class when initializing an
object in ECJ is to use the global EvolutionState object to walk through
the program's state and find what you want.

So, in the 'setup()' method of your BusProblemLine class, you would
retrieve the Species object with something like this:

final GeneVectorSpecies species = (GeneVectorSpecies)
state.population.subpops[0].species;


On Mon, Dec 19, 2016 at 9:11 AM, Enzo Fabbiani <[log in to unmask]> wrote:

> Hi there, I'm facing some trouble when trying to initialize population.
>
> My custom class BusProblemLine (which extends from Gene) implements reset
> function.
>
> In order to do that, some problem information is needed. This info is read
> from files and loaded into atributes in the setup function in
> GeneVectorSpecies and can be accessed from evaluate function in my problem
> class.
>
> How can I access to this information in BusProblemLine to initialize the
> population (as well as mutate and crossover).
>
> I've tried to read data in the reset function but it explodes for out of
> memory. What is more, it gets initializing more times than the population
> size, is this ok?
>
> Regards,
> Enzo
>



-- 

Ph.D student in Computer Science, George Mason University
CFO and Web Director, Journal of Mason Graduate Research
http://mason.gmu.edu/~escott8/


ATOM RSS1 RSS2