Perfect!
BTW, in the comment at the top of ERC.java, it says:
"Remember that if your ERC value isn't a simple or mutable type (like
an int or a string), you'll have to deep-clone it in an overridden
clone() method."
Should that be "immutable"?
Peter Drake
http://www.lclark.edu/~drake/
On May 11, 2008, at 7:29 AM, Sean Luke wrote:
> It depends. If you only have a small number of choices for
> constant values, you could make different GPNode subclasses for
> each class.
>
> If you have a large number of choices, you should create a subclass
> ERC.java, which already does all the hard work for you.
>
> Sean
>
> On May 10, 2008, at 7:47 PM, Peter Drake wrote:
>
>> If I want to have various numeric constants as terminal nodes, I
>> should define a class NumericConstant that extends GPNode, with
>> each instance of this class able to hold a different value ... right?
>>
>> Apologies in advance for what will no doubt be a long series of
>> foolish questions as I get my head around this system.
>>
>> Peter Drake
>> http://www.lclark.edu/~drake/
>>
|