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

Fix some style issues

parent cdb2830d
No related branches found
No related tags found
No related merge requests found
Pipeline #1033 failed
...@@ -46,7 +46,7 @@ public class TrainerParameters { ...@@ -46,7 +46,7 @@ public class TrainerParameters {
* the algorithm stop * the algorithm stop
*/ */
public TrainerParameters( public TrainerParameters(
Logger logger, final Logger logger,
final int population_size, final int population_size,
final int crossover_rate, final int crossover_rate,
final int mutation_rate, final int mutation_rate,
...@@ -129,7 +129,7 @@ public class TrainerParameters { ...@@ -129,7 +129,7 @@ public class TrainerParameters {
* Getter for selection method. * Getter for selection method.
* @return int * @return int
*/ */
int getSelectionMethod() { final int getSelectionMethod() {
return selection_method; return selection_method;
} }
......
package be.cylab.java.wowa.training; package be.cylab.java.wowa.training;
import javax.rmi.CORBA.Util;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
public class Utils { /**
* Class Utils.
* Contain tools for Trainer algorithm
*/
public final class Utils {
private Utils() {
}
/** /**
* @param weights * @param weights
* @return * @return
*/ */
public static double[] normalizeWeights(final double[] weights) { public static double[] normalizeWeights(final double[] weights) {
double sum_weight = Utils.sumArrayElements(weights); double sum_weight = Utils.sumArrayElements(weights);
double[] weightsNormalized = new double[weights.length]; double[] weights_normalized = new double[weights.length];
for (int i = 0; i < weights.length; i++) { for (int i = 0; i < weights.length; i++) {
weightsNormalized[i] = weights[i] / sum_weight; weights_normalized[i] = weights[i] / sum_weight;
} }
return weightsNormalized; return weights_normalized;
} }
/** /**
......
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