Using variables for the decision variables bounds (lower,upper).
A Free and Open Source Java Framework for Multiobjective Optimization
Brought to you by:
dhadka
Hi
Is it possible to set the decision variables bounds (lower & upper) to a variables declared somewhere else in my program out side the newSolution method ?????
like this
solution.setVariable(i, EncodingUtils.newReal(small,large));
and the variables small and large are declared and assigned values out side the newSolution method().
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 could try extending the RealVariable class and overriding the getLowerBound() and getUpperBound() methods.
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 the reply
Due of being a new user of Java as well MOEA, please can you provide me with more details about how to extend the RealVariable class .
This is part of my code
@Override
public void evaluate (Solution solution) {
.....
.....
// finding the smallest and largest numbers in the data set
largest = points [0] [0] ;
smallest = points [0] [0] ;
for (int i = 0; i < 40; ++i)
{
for (int j = 0; j < 3; ++j)
{
if(points[i] [j] > largest)
largest = points[i] [j];
else if (points[i] [j] < smallest)
smallest = points[i] [j];
}
}
............
............
@Override
public Solution newSolution ()
{
Solution solution = new Solution(numberOfVariables,
numberOfObjectives);
for(int i=0; i< numberOfVariables; i++)
{
solution.setVariable(i, new RealVariable(smallest, largest));
}
return solution;
}
Thank you