Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 7: Encog throws exception on some GA's #9

Closed
jeffheaton opened this issue Jul 29, 2011 · 1 comment
Closed

Java 7: Encog throws exception on some GA's #9

jeffheaton opened this issue Jul 29, 2011 · 1 comment
Assignees
Milestone

Comments

@jeffheaton
Copy link
Owner

The following error is thrown on some GA's when Encog is run under Java 7.

Got this error when I ran the Lunar Lander Example:

Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.ComparableTimSort.mergeLo(Unknown Source)
at java.util.ComparableTimSort.mergeAt(Unknown Source)
at java.util.ComparableTimSort.mergeCollapse(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at org.encog.ml.genetic.population.BasicPopulation.sort(BasicPopulation.java:445)
at org.encog.neural.networks.training.genetic.NeuralGeneticAlgorithm.(NeuralGeneticAlgorithm.java:134)
at org.encog.examples.neural.lunar.LunarLander.main(LunarLander.java:71)

@ghost ghost assigned jeffheaton Jul 29, 2011
@jeffheaton
Copy link
Owner Author

Fixed issue by adding an equals method and using it inside of compareTo. Was a valid bug that would cause issues with integer scores.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant