ECJ-INTEREST-L Archives

August 2006

ECJ-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Date:
Mon, 21 Aug 2006 11:05:35 +0900
MIME-version:
1.0 (Apple Message framework v752.2)
Reply-To:
ECJ Evolutionary Computation Toolkit <[log in to unmask]>
Content-type:
text/plain; charset=US-ASCII; delsp=yes; format=flowed
Subject:
From:
Sean Luke <[log in to unmask]>
In-Reply-To:
Content-transfer-encoding:
7bit
Comments:
To: ECJ Evolutionary Computation Toolkit <[log in to unmask]>
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