Hi I am a new user of MOEA. I have a linear optimization problem with one decision variable, three objectives and two constraints. I am trying to construct this problem with MOEA but failed.
My problem's detail is like this:
Objective 1: Maximize sum[EPDO(i)*X(i)]; Objective 2: Maximize sum[SCD(i)*X(i)]; Objective 3:Maximize sum[ASV(i)*X(i)]. Where: EPDO(i),SCD(i) and ASV(i) are parameters which I want to read from Excel. X(i) is a decision variable. i from 0 to 300. And constraints are sum[X(i)]=5000; and any X(i)>0 and<1000;
I don't know this kind of problem should be customized and constructed based on the implementation of problem, abstract problem or any other listed problems within MOEA since I felt that any of the listed examples in MOEA is not applicable to my problem.
Looking forward to your reply.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
In general, you should extend AbstractProblem. There are only two methods you need to implement:
newSolution
andevaluate
. An example of a simple problem with 1 decision variable, 2 objectives, and 1 constraint is shown below:View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hi, thank you for your quick response.
Based on the material you provided, I constructed the codes for my problem "NgbrPro", but it seems incorrect. Could you please give me some advises? Looking forward to your reply soon.
// Construct NgbrPro within MOEA Abstract Problem
public class NgbrPro extends AbstractProblem {
// define Parameters
static double [] neighbor;
// Parameter 2: EPDO/km
static double [] EPDO;
// Parameter 3: School Density
static double [] SCD;
//Parameter 4: Average Speed violation
static double [] ASV;
// Read Parameters from Excel to Java List
public static void Read(){
try {
//Find the location of the file
FileInputStream file = new FileInputStream(new File("E:"+File.separator+"ua2015"+File.separator+"PRC Project"+File.separator+"04. Optimization and Scheduling"+File.separator+"01. NGHBR Model"+File.separator+"Java Parameter Input.xlsx"));
}
//Input Excel value to Parameters
public static void InputP() {
int i=0;
int j=4;
neighbor=new double[num];
EPDO=new double [num];
SCD=new double [num];
ASV=new double [num];
for (i=0,j=4;j<results.size();i++,j=j+4){
neighbor[i]=Double.valueOf(results.get(j).getValue());
EPDO[i]=Double.valueOf(results.get(j+1).getValue());
SCD[i]=Double.valueOf(results.get(j+2).getValue());
ASV[i]=Double.valueOf(results.get(j+3).getValue());
Last edit: Anonymous 2015-07-27
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
One issue I see is its defining a single variable, an integer
but then trying to read that as a permutation
Everything else from the MOEA aspect appears to be correct.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hi, how to define a vector variable int[] with bounded constraints in MOEA?
When set Variable using solution.setVarialbe(0,Variable), I cannot find the definition of setting int[] with bounded constraints using EncodingUtils function.
Last edit: Anonymous 2015-07-28
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
You'll want to set individual variables for each value:
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hi, thank you for reply.
Then question comes to modify "evaluate" method. Since the 20 variables have been set in Override of "Solution" method, I just defined the objective with the calling of solution.getVariable(i) as follows and showed problematic:
for (int i=0; i<results.size;i++){
E+= excelrw.EPDO[i]*solution.getVariable(i);}
Do I still need to define int [] x= EncodingUtils.getInt(??) before? But I don't know what should I input in the EncodingUtils.getInt().
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
You can either get all values at once:
Or read each value individually:
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hi My problem was solved! Thank you very much.
But why even when the constraints were satisfied, showing zero, with the increasing number of iterations, the solutions were changes slightly every iteration (I mean the value of objectives and variables). Why there is no an exact solution?