All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jeco.core.problems.zdt.ZDT Maven / Gradle / Ivy

The newest version!
package jeco.core.problems.zdt;

import jeco.core.problem.Problem;
import jeco.core.problem.Solution;
import jeco.core.problem.Solutions;
import jeco.core.problem.Variable;
import jeco.core.util.random.RandomGenerator;

public abstract class ZDT extends Problem> {

	public ZDT(Integer numberOfVariables) {
		super(numberOfVariables, 2);
	}

	public Solutions> newRandomSetOfSolutions(int size) {
		Solutions> solutions = new Solutions>();
		for (int i=0; i> solI = new Solution>(numberOfObjectives);
			for (int j = 0; j < numberOfVariables; ++j) {
				Variable varJ = new Variable(RandomGenerator.nextDouble(lowerBound[j], upperBound[j]));
				solI.getVariables().add(varJ);
			}
			solutions.add(solI);
		}
		return solutions;
	}
	
  public void evaluate(Solutions> solutions) {
  	for(Solution> solution : solutions)
  		this.evaluate(solution);
  }

  public abstract void evaluate(Solution> solution);    

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy