Skip to content

Commit

Permalink
Simplify the folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Nov 30, 2023
1 parent dc58b75 commit 75a1ce0
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
*/
package org.moeaframework.benchmarks;

import org.moeaframework.benchmarks.CarSideImpact.CarSideImpact;
import org.moeaframework.benchmarks.ElectricMotor.ElectricMotor;
import org.moeaframework.benchmarks.GAA.GAA;
import org.moeaframework.benchmarks.HBV.HBV;
import org.moeaframework.benchmarks.LRGV.LRGV;
import org.moeaframework.benchmarks.LakeProblem.LakeProblem;
import org.moeaframework.benchmarks.WDS.WDS;
import org.moeaframework.benchmarks.WDS.WDSInstance;
import org.moeaframework.core.spi.RegisteredProblemProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< Updated upstream:src/main/java/org/moeaframework/benchmarks/CarSideImpact/CarSideImpact.java
/* Copyright 2009-2023 David Hadka and other contributors
*
* This file is part of the MOEA Framework.
Expand All @@ -16,6 +17,9 @@
* along with the MOEA Framework. If not, see <http://www.gnu.org/licenses/>.
*/
package org.moeaframework.benchmarks.CarSideImpact;
=======
package org.moeaframework.benchmarks;
>>>>>>> Stashed changes:src/main/java/org/moeaframework/benchmarks/CarSideImpact.java

import org.moeaframework.core.Solution;
import org.moeaframework.core.variable.EncodingUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< Updated upstream:src/main/java/org/moeaframework/benchmarks/ElectricMotor/ElectricMotor.java
/* Copyright 2009-2023 David Hadka and other contributors
*
* This file is part of the MOEA Framework.
Expand All @@ -16,6 +17,9 @@
* along with the MOEA Framework. If not, see <http://www.gnu.org/licenses/>.
*/
package org.moeaframework.benchmarks.ElectricMotor;
=======
package org.moeaframework.benchmarks;
>>>>>>> Stashed changes:src/main/java/org/moeaframework/benchmarks/ElectricMotor.java

import org.moeaframework.core.Solution;
import org.moeaframework.core.variable.EncodingUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2004, 2010-2012 Timothy W. Simpson and others. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * ---------------------------------------------------------------------- * * General Aviation Aircraft Problem using Response Surface Model * * This software was developed at the Pennsylvania State University by * Dr. Timothy Simpson, Dr. Patrick Reed, Brayan D'Souza, Ruchit Shah, * Matthew Woodruff, and David Hadka. If this software is used in * academic publications, please cite the following papers accordingly: * * [1] T. W. Simpson, W. Chen, J. K. Allen, and F. Mistree (1996), * "Conceptual design of a family of products through the use of * the robust concept exploration method," in 6th AIAA/USAF/NASA/ * ISSMO Symposium on Multidiciplinary Analysis and Optimization, * vol. 2, pp. 1535-1545. * * [2] T. W. Simpson, B. S. D'Souza (2004), "Assessing variable levels * of platform commonality within a product family using a * multiobjective genetic algorithm," Concurrent Engineering: * Research and Applications, vol. 12, no. 2, pp. 119-130. * * [3] R. Shah, P. M. Reed, and T. W. Simpson (2011), "Many-objective * evolutionary optimization and visual analytics for product * family design," Multiobjective Evolutionary Optimisation for * Product Design and Manufacturing, Springer, London, pp. 137-159. * * [4] D. Hadka, P. M. Reed, and T. W. Simpson (2012), "Diagnostic * Assessment of the Borg MOEA on Many-Objective Product Family * Design Problems," WCCI 2012 World Congress on Computational * Intelligence, Congress on Evolutionary Computation, Brisbane, * Australia, pp. 986-995. */package org.moeaframework.benchmarks.GAA;
/* Copyright 2004, 2010-2012 Timothy W. Simpson and others. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * ---------------------------------------------------------------------- * * General Aviation Aircraft Problem using Response Surface Model * * This software was developed at the Pennsylvania State University by * Dr. Timothy Simpson, Dr. Patrick Reed, Brayan D'Souza, Ruchit Shah, * Matthew Woodruff, and David Hadka. If this software is used in * academic publications, please cite the following papers accordingly: * * [1] T. W. Simpson, W. Chen, J. K. Allen, and F. Mistree (1996), * "Conceptual design of a family of products through the use of * the robust concept exploration method," in 6th AIAA/USAF/NASA/ * ISSMO Symposium on Multidiciplinary Analysis and Optimization, * vol. 2, pp. 1535-1545. * * [2] T. W. Simpson, B. S. D'Souza (2004), "Assessing variable levels * of platform commonality within a product family using a * multiobjective genetic algorithm," Concurrent Engineering: * Research and Applications, vol. 12, no. 2, pp. 119-130. * * [3] R. Shah, P. M. Reed, and T. W. Simpson (2011), "Many-objective * evolutionary optimization and visual analytics for product * family design," Multiobjective Evolutionary Optimisation for * Product Design and Manufacturing, Springer, London, pp. 137-159. * * [4] D. Hadka, P. M. Reed, and T. W. Simpson (2012), "Diagnostic * Assessment of the Borg MOEA on Many-Objective Product Family * Design Problems," WCCI 2012 World Congress on Computational * Intelligence, Congress on Evolutionary Computation, Brisbane, * Australia, pp. 986-995. */package org.moeaframework.benchmarks;
import static java.lang.Math.pow;import org.moeaframework.core.Solution;import org.moeaframework.core.variable.EncodingUtils;import org.moeaframework.core.variable.RealVariable;import org.moeaframework.problem.AbstractProblem;
/**
* The General Aviation Aircraft (GAA) problem designed for use with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with the HBV Benchmark Problem. If not, see <http://www.gnu.org/licenses/>.
*/
package org.moeaframework.benchmarks.HBV;
package org.moeaframework.benchmarks;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< Updated upstream:src/main/java/org/moeaframework/benchmarks/LRGV/LRGV.java
/* Copyright 2009-2023 David Hadka and other contributors
*
* This file is part of the MOEA Framework.
Expand All @@ -16,6 +17,9 @@
* along with the MOEA Framework. If not, see <http://www.gnu.org/licenses/>.
*/
package org.moeaframework.benchmarks.LRGV;
=======
package org.moeaframework.benchmarks;
>>>>>>> Stashed changes:src/main/java/org/moeaframework/benchmarks/LRGV.java

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< Updated upstream:src/main/java/org/moeaframework/benchmarks/LakeProblem/LakeProblem.java
/* Copyright 2009-2023 David Hadka and other contributors
*
* This file is part of the MOEA Framework.
Expand All @@ -16,6 +17,9 @@
* along with the MOEA Framework. If not, see <http://www.gnu.org/licenses/>.
*/
package org.moeaframework.benchmarks.LakeProblem;
=======
package org.moeaframework.benchmarks;
>>>>>>> Stashed changes:src/main/java/org/moeaframework/benchmarks/LakeProblem.java

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.moeaframework.benchmarks.Radar;
package org.moeaframework.benchmarks;

import java.io.File;
import java.io.IOException;
Expand Down
126 changes: 126 additions & 0 deletions src/main/java/org/moeaframework/benchmarks/WDS.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
package org.moeaframework.benchmarks;

import java.io.File;

import org.apache.commons.lang3.SystemUtils;
import org.moeaframework.core.Solution;
import org.moeaframework.core.variable.EncodingUtils;
import org.moeaframework.problem.NativeProblem;

/**
* The water distribution system (WDS) problem.
*
* @see https://engineering.exeter.ac.uk/research/cws/resources/benchmarks/pareto/
*/
public class WDS extends NativeProblem {

public enum WDSInstance {

TRN("TRN", 8, 8, new double[] { 0.01, 0.001 }),

TLN("TLN", 8, 14, new double[] { 0.01, 0.001 }),

BAK("BAK", 9, 11, new double[] { 0.001, 0.001 }),

NYT("NYT", 21, 16, new double[] { 1, 0.001 }),

BLA("BLA", 23, 14, new double[] { 0.001, 0.001 }),

HAN("HAN", 34, 6, new double[] { 0.01, 0.001 }),

GOY("GOY", 30, 8, new double[] { 0.001, 0.001 }),

FOS("FOS", 58, 22, new double[] { 0.001, 0.001 }),

PES("PES", 99, 13, new double[] { 0.01, 0.001 }),

MOD("MOD", 317, 13, new double[] { 0.01, 0.001 }),

BIN("BIN", 454, 10, new double[] { 0.01, 0.001 }),

EXN("EXN", 567, 11, new double[] { 0.01, 0.001 });

private final String name;

private final int numberOfVariables;

private final int numberOfOptions;

private final double[] epsilon;

WDSInstance(String name, int numberOfVariables, int numberOfOptions, double[] epsilon) {
this.name = name;
this.numberOfVariables = numberOfVariables;
this.numberOfOptions = numberOfOptions;
this.epsilon = epsilon;
}

public String getName() {
return name;
}

public int getNumberOfVariables() {
return numberOfVariables;
}

public int getNumberOfOptions() {
return numberOfOptions;
}

public double[] getEpsilon() {
return epsilon.clone();
}

}

public static final String PATH = "./native/WDS/bin/";

private final WDSInstance instance;

public WDS(WDSInstance instance) {
super(createProcess(instance));
this.instance = instance;
}

public static ProcessBuilder createProcess(WDSInstance instance) {
String command = SystemUtils.IS_OS_WINDOWS ?
PATH + instance.getName() + ".exe" :
"./" + instance.getName();

return new ProcessBuilder()
.command(command)
.directory(new File(PATH));
}

@Override
public String getName() {
return instance.getName();
}

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

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

@Override
public int getNumberOfVariables() {
return instance.getNumberOfVariables();
}

@Override
public Solution newSolution() {
Solution solution = new Solution(instance.getNumberOfVariables(), 2, 1);

for (int i = 0; i < instance.getNumberOfVariables(); i++) {
solution.setVariable(i, EncodingUtils.newInt(0, instance.getNumberOfOptions()-1));
}

return solution;
}

}

0 comments on commit 75a1ce0

Please sign in to comment.