If you mean a GPIndividual, there is no built-in function for this.
But it's very straightforward:
For each tree
node = tree root
c += count(root, function.class)
c = 0
for each child in node.children
c += count(child, class)
if node.class == class
c += 1
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.
>> 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
>>> Peter Drake
>>> Assistant Professor of Computer Science
>>> Lewis & Clark College