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

jeco.core.problems.dtlz.DTLZ Maven / Gradle / Ivy

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

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 DTLZ extends Problem> {

    public DTLZ(Integer numberOfVariables) {
        super(numberOfVariables, 3);
    }

  	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