|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
GreedyCrossOver using IntegerGene in distance()Hi,
I've just downloaded JGAP with a view to learn how to use it. I thought I'll start with the TravellingSalesman example first. I have modified the example class to use StringGene instead of IntegerGene and have updated the abstract distance method to my own distance function. When I execute the code, I get a ClassCastException thrown by GreedyCrossover.distance saying that it was expecting IntegerGene and not StringGene. Looking at the docs for GreedyCrossover, it says that the distance function just takes the difference between the two IntegerGene functions - the same as the sample code. How do I make it use the distance function that I have written. Do I have to modify the class as provided by JGAP or do I just extend it. If I extend it, what else do I need to change in the TravellingSalesman class to make it use the extended class. Thanks Vivek ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ jgap-users mailing list jgap-users@... https://lists.sourceforge.net/lists/listinfo/jgap-users |
|
|
|
| Free Forum Powered by Nabble | Forum Help |