Skip to content
Snippets Groups Projects
Commit d4b89ac0 authored by a.croix's avatar a.croix
Browse files

Fix checkstyle issues

parent e1e8e3ac
No related branches found
No related tags found
1 merge request!2Add AUC as a score for distance
Pipeline #1322 passed
package be.cylab.java.wowa.training; package be.cylab.java.wowa.training;
import java.lang.reflect.InvocationTargetException;
/** /**
* Class to generate objects. * Class to generate objects.
...@@ -18,13 +17,14 @@ public class Factory { ...@@ -18,13 +17,14 @@ public class Factory {
/** /**
* @return * @return
*/ */
public AbstractSolution createSolutionObject(final int a) { public final AbstractSolution createSolutionObject(final int a) {
if (this.solution_type instanceof SolutionDistance) { if (this.solution_type instanceof SolutionDistance) {
return new SolutionDistance(a); return new SolutionDistance(a);
} else if (this.solution_type instanceof SolutionAUC) { } else if (this.solution_type instanceof SolutionAUC) {
return new SolutionAUC(a); return new SolutionAUC(a);
} else { } else {
throw new IllegalArgumentException("Provide o correct type of Solution"); throw new IllegalArgumentException(
"Provide o correct type of Solution");
} }
} }
} }
...@@ -95,7 +95,8 @@ public class Trainer { ...@@ -95,7 +95,8 @@ public class Trainer {
List<AbstractSolution> population = new ArrayList<>(); List<AbstractSolution> population = new ArrayList<>();
for (int i = 0; i < population_size; i++) { for (int i = 0; i < population_size; i++) {
AbstractSolution solution = this.factory.createSolutionObject(number_of_weights); AbstractSolution solution
= this.factory.createSolutionObject(number_of_weights);
population.add(solution); population.add(solution);
} }
return population; return population;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment