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

org.moeaframework.benchmarks.LakeProblem Maven / Gradle / Ivy

The newest version!
/* Copyright 2009-2024 David Hadka and other contributors
 *
 * This file is part of the MOEA Framework.
 *
 * The MOEA Framework is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * The MOEA Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with the MOEA Framework.  If not, see .
 */
package org.moeaframework.benchmarks;

import java.io.File;

import org.moeaframework.core.Solution;
import org.moeaframework.core.variable.RealVariable;
import org.moeaframework.problem.NativeCommand;
import org.moeaframework.problem.NativeProblem;

public class LakeProblem extends NativeProblem {
	
	public static final double[] EPSILON = {
		0.01, 0.01, 0.0001, 0.0001
	};
	
	public static final NativeCommand COMMAND = new NativeCommand("lake",
			new String[] { },
			new File("./native/LakeProblem/bin/"));
	
	public LakeProblem() {
		super(COMMAND);
	}

	@Override
	public String getName() {
		return "LakeProblem";
	}

	@Override
	public int getNumberOfVariables() {
		return 100;
	}

	@Override
	public int getNumberOfObjectives() {
		return 4;
	}

	@Override
	public int getNumberOfConstraints() {
		return 1;
	}

	@Override
	public Solution newSolution() {
		Solution solution = new Solution(100, 4, 1);
		
		for (int i = 0; i < 100; i++) {
			solution.setVariable(i, new RealVariable(0.0, 0.1));
		}
		
		return solution;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy