evolutionary algorithm output problem description:
While evolutionaryAlgorithm example is running I receive IOException after
first iteration:
IOException
java.lang.IllegalStateException: Exception while evaluating the population
at
org.apache.mahout.ga.watchmaker.MahoutFitnessEvaluator.evaluate(MahoutFitnessEvaluator.java:40)
at
org.apache.mahout.ga.watchmaker.STFitnessEvaluator.getFitness(STFitnessEvaluator.java:39)
at
org.uncommons.watchmaker.framework.SequentialEvolutionEngine.evaluatePopulation(SequentialEvolutionEngine.java:105)
at
org.uncommons.watchmaker.framework.AbstractEvolutionEngine.evolvePopulation(AbstractEvolutionEngine.java:234)
at
org.uncommons.watchmaker.framework.AbstractEvolutionEngine.evolve(AbstractEvolutionEngine.java:125)
at
org.uncommons.watchmaker.framework.AbstractEvolutionEngine.evolve(AbstractEvolutionEngine.java:103)
at
org.apache.mahout.ga.watchmaker.travellingsalesman.EvolutionaryTravellingSalesman.calculateShortestRoute(EvolutionaryTravellingSalesman.java:156)
at
org.apache.mahout.ga.watchmaker.travellingsalesman.ConsoleTravellingSalesman$TSSwingBackgroundTask.performTask(ConsoleTravellingSalesman.java:99)
at
org.apache.mahout.ga.watchmaker.travellingsalesman.ConsoleTravellingSalesman$TSSwingBackgroundTask.performTask(ConsoleTravellingSalesman.java:81)
at
org.uncommons.swing.SwingBackgroundTask$1.run(SwingBackgroundTask.java:63)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:180)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at
org.apache.hadoop.io.SequenceFile$Reader.init(SequenceFile.java:1465)
at
org.apache.hadoop.io.SequenceFile$Reader.<init>(SequenceFile.java:1437)
at
org.apache.hadoop.io.SequenceFile$Reader.<init>(SequenceFile.java:1360)
at
org.apache.hadoop.io.SequenceFile$Sorter$SegmentDescriptor.nextRawKey(SequenceFile.java:3087)
at
org.apache.hadoop.io.SequenceFile$Sorter$MergeQueue.merge(SequenceFile.java:2902)
at
org.apache.hadoop.io.SequenceFile$Sorter.merge(SequenceFile.java:2631)
at
org.apache.hadoop.io.SequenceFile$Sorter.merge(SequenceFile.java:2602)
at
org.apache.hadoop.io.SequenceFile$Sorter.merge(SequenceFile.java:2716)
at
org.apache.mahout.ga.watchmaker.OutputUtils.importEvaluations(OutputUtils.java:87)
at
org.apache.mahout.ga.watchmaker.MahoutEvaluator.evaluate(MahoutEvaluator.java:73)
at
org.apache.mahout.ga.watchmaker.MahoutFitnessEvaluator.evaluate(MahoutFitnessEvaluator.java:37)
... 10 more
I (probably) find a bug (if it’s bug) and solve it through delete output
folder before every iteration.
(https://github.com/windDanie/mahout/commit/7c6eba874ea618c0c6a93e71bbe3e7734d5c7367<https://docs.google.com/document/d/1oD1nUKpBu5qHWbbc98tJgfAJvUEp1nNLRENuQL9-26M/(https://github.com/windDanie/mahout/commit/7c6eba874ea618c0c6a93e71bbe3e7734d5c7367>).
I found place, where output folder existence is checked and throwed
FileAlreadyExistsException (in hadoopCore: FileOutputFormat, line 122).
What do You think about it?