ECJ-INTEREST-L Archives

January 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:
Fri, 6 Jan 2006 10:28:35 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (46 lines)
If you mean a GPIndividual, there is no built-in function for this.   
But it's very straightforward:

c=0
For each tree
node = tree root
c += count(root, function.class)

count(node, class):
c = 0
for each child in node.children
c += count(child, class)
if node.class == class
c += 1
return c


On Jan 6, 2006, at 6:01 AM, Hauptman Ami wrote:

> Is there any way to count the number appearances of functions
> inside each individual?
>
> (If possible, this may help with diversity)
>
> ---Ami H.
>
> On Thu 05 Jan 21:43 2006 Sean Luke wrote:
>> ECJ has no built-in statistics for population diversity; and there
>> are many such measures in the literature. You'd implement one in a
>> Statistics subclass.
>>
>> Sean
>>
>> On Jan 5, 2006, at 2:38 PM, Peter Drake wrote:
>>
>>> Is there some easy way to measure population diversity built into
>>> ECJ? I'd like to know when and to what extent my population is
>>> converging.
>>>
>>> Thanks,
>>>
>>> Peter Drake
>>> Assistant Professor of Computer Science
>>> Lewis & Clark College
>>> http://www.lclark.edu/~drake/

ATOM RSS1 RSS2