ECJ-INTEREST-L Archives

August 2006

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text 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:
Sean Luke <[log in to unmask]>
Reply To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Mon, 21 Aug 2006 11:05:35 +0900
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
If you mean to select a random individual from the population, and  
you only have one subpopulation, then you just go into the
subpopulation's individuals array and grab one. Something along the
lines of:

int numInds = state.population.subpops[0].individuals.length;
int randomIndex = state.random[thread].nextInt(numInds);
GPIndividual opponent = (GPIndividual)(state.population.subpops
[0].individuals[randomIndex]);

On Aug 21, 2006, at 5:13 AM, Robert Baruch wrote:

> Hi all,
>
> I'm using ECJ 15. I'm having a difficult time finding an API
> accessible through GPProblem.evaluate
> that will let me pick a random opponent individual to play against
> the current individual under
> evaluation.
>
> Any ideas?
>
> Thanks!
>
> --Rob

ATOM RSS1 RSS2