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

Fix checkstyle issues

parent c9aedcc1
No related branches found
No related tags found
No related merge requests found
Pipeline #1291 failed
......@@ -4,7 +4,11 @@ import java.util.Arrays;
import java.util.List;
import java.util.Random;
public abstract class AbstractSolution implements Comparable<AbstractSolution>, Cloneable{
/**
* Abstract class Solution.
*/
public abstract class AbstractSolution
implements Comparable<AbstractSolution>, Cloneable {
protected double[] weights_w;
protected double[] weights_p;
......@@ -61,6 +65,7 @@ public abstract class AbstractSolution implements Comparable<AbstractSolution>,
/**
* Change a random gene in a weight vector.
* The gene is changed is the probability is higher than a random double
*
* @param probability
*/
final void randomlyMutateWithProbability(final double probability) {
......@@ -100,7 +105,7 @@ public abstract class AbstractSolution implements Comparable<AbstractSolution>,
}
/**
*Function to normalize SolutionDistance weights.
* Function to normalize SolutionDistance weights.
* Weights must be between 0 and 1 and the sum of the weight in a vector
* must be equal to 1
*/
......@@ -116,6 +121,9 @@ public abstract class AbstractSolution implements Comparable<AbstractSolution>,
return distance;
}
/**
* @param distance
*/
public final void setDistance(final double distance) {
return;
}
......@@ -149,7 +157,6 @@ public abstract class AbstractSolution implements Comparable<AbstractSolution>,
}
/**
* Copy.
*
......
package be.cylab.java.wowa.training;
import be.cylab.java.roc.Point;
import info.debatty.java.aggregation.WOWA;
import java.util.ArrayList;
import java.util.List;
/**
* Child class Solution.
* Fitness criterion is AUC
*/
public class SolutionAUC extends AbstractSolution {
public SolutionAUC(int weight_number) {
/**
* Default constructor.
* @param weight_number
*/
public SolutionAUC(final int weight_number) {
super(weight_number);
}
final void computeScoreTo(List<double[]> data, double[] expected) {
final void computeScoreTo(
final List<double[]> data,
final double[] expected) {
this.distance = 0;
double[] aggregated_values = new double[data.size()];
WOWA wowa = new WOWA(this.weights_w, this.weights_p);
......
......@@ -19,6 +19,11 @@ public class SolutionDistance extends AbstractSolution {
super(weights_number);
}
/**
* Constructor used for tests.
* @param weights_number
* @param seed
*/
public SolutionDistance(final int weights_number, final int seed) {
super(weights_number, seed);
}
......
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