Print

Print


On May 11, 2008, at 9:13 PM, Sean Luke wrote:

> On May 11, 2008, at 7:07 PM, Peter Drake wrote:
>
>> # Types
>> gp.a.size = 2 # Two atomic types
>> gp.a.0.name = sequence
>> gp.a.1.name = move
>
> Try:
>
> gp.type.a.size = 2 # Two atomic types
> gp.type.a.0.name = sequence
> gp.type.a.1.name = move

If I try that, I get:

Processing GP Types
FATAL ERROR:
The number of GP atomic types must be at least 1.
PARAMETER: gp.type.a.size

On a whim, I though maybe it's not safe to put a # comment at the end  
of a line. Removing that, I get:

Processing GP Types
Processing GP Node Constraints
Processing GP Function Sets
Processing GP Tree Constraints
ERROR:
The GP type "nil" could not be found.
SYSTEM EXITING FROM ERRORS

Perhaps I need to tell the system that trees should be of type sequence:

gp.tc.0.returns = sequence

The result:

Processing GP Tree Constraints
WARNING:
In function set f0 for the GPTreeConstraints tc0, no *nonterminals*  
are given with the return type move which is required by other  
functions in the function set or by the tree's return type.  This may  
or may not be a problem for you.
PARAMETER: gp.tc.0
Initializing Generation 0
ONCE-ONLY WARNING:
A GPNodeBuilder has been requested at least once to generate a one- 
node tree with a return value type-compatable with a certain type;  
but there is no NON-TERMINAL which is type-compatable in this way.   
As a result, the algorithm was forced to use a TERMINAL, making the  
tree larger than requested, and exposing more child slots to fill,  
which if not carefully considered, could recursively repeat this  
problem and eventually fill all memory.
ONCE-ONLY WARNING:
class ec.gp.koza.HalfBuilder can't find a terminal type-compatable  
with move

The first warning is "not a problem for" me; I intend the first child  
of each PlayMove or IfNode to be a single MoveNode. Is it possible/ 
desirable to suppress this warning?

The second and third warnings imply that I somehow have to declare  
MoveNode and RandomNode terminal. How do I do this?

The system does appear to be generating the tree properly now, but  
I'd like to do things the Right Way.

Thanks,

Peter Drake
http://www.lclark.edu/~drake/