Re: [jgap-users] JGAP GP - Variable and Boolean functions
Brought to you by:
klausikm
From: Klaus M. <jg...@kl...> - 2010-01-13 09:02:18
|
Karthun, GreaterThan returns a boolean exclusively. But you have to specify what the input type for GreaterThan is (Integer, Double, Boolean, Float,....) The message you get does not relate to the return type of your whole program. If you want to avoid it, add the statement config.setStrictProgramCreation(false); (instead of true). With that I get from your source the solution; X > 0 which is perfect. Best Klaus www.klaus-meffert.com <http://www.klaus-meffert.com/> _____ From: Karthun [mailto:vf...@wa...] Sent: Tuesday, January 12, 2010 7:28 PM To: Klaus Meffert Cc: jga...@li... Subject: Re: [jgap-users] JGAP GP - Variable and Boolean functions Hi Klaus, Thanks for your answer. My understanding is that the GreaterThan function must return the same type than variable vx. I am confused about the semantic of this function returning an Integer or Double though. I would expect such function returning a boolean exclusively. This is maybe why I am so confused by GP. I anyway tried using an Integer as suggested in your reply but I received the following exception: Chromosome (depth 0, index 0) requires a function of return type class java.lang.Integer (sub return type 0) but there is no such node available This is surprising since the return type of the program should be a Boolean. Find attached the code I am using for this test case. |