Skip to content

Commit 9a22528

Browse files
committed
Updating for example
1 parent 6e729df commit 9a22528

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>com.github.vinixnan</groupId>
2323
<artifactId>jMetalHyperHeuristicHelper</artifactId>
24-
<version>1.5</version>
24+
<version>1.6</version>
2525
</dependency>
2626
<dependency>
2727
<groupId>org.projectlombok</groupId>

src/main/java/br/usp/poli/pcs/lti/moabhh/agents/IndicatorVoter.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package br.usp.poli.pcs.lti.moabhh.agents;
22

33
import br.usp.poli.pcs.lti.jmetalhhhelper.core.DoubleTaggedSolution;
4+
import br.usp.poli.pcs.lti.jmetalhhhelper.core.PermutationTaggedSolution;
45
import br.usp.poli.pcs.lti.jmetalhhhelper.core.TaggedSolution;
56
import br.usp.poli.pcs.lti.jmetalhhhelper.util.IndicatorFactory;
67
import br.usp.poli.pcs.lti.jmetalhhhelper.util.metrics.*;
@@ -23,6 +24,7 @@
2324
import java.util.logging.Logger;
2425
import org.apache.commons.math3.stat.StatUtils;
2526
import org.uma.jmetal.problem.DoubleProblem;
27+
import org.uma.jmetal.problem.PermutationProblem;
2628

2729
import org.uma.jmetal.problem.Problem;
2830
import org.uma.jmetal.solution.Solution;
@@ -166,7 +168,13 @@ public void run() {
166168
}
167169
List<S> pts=new ArrayList<>();
168170
for (int i = 0; i < idealPoints.length; i++) {
169-
Solution pt=new DoubleTaggedSolution((DoubleProblem) problem);
171+
Solution pt;
172+
if(problem instanceof DoubleProblem){
173+
pt=new DoubleTaggedSolution((DoubleProblem) problem);
174+
}
175+
else{
176+
pt=new PermutationTaggedSolution((PermutationProblem) problem);
177+
}
170178
for (int j = 0; j < idealPoints.length; j++) {
171179
pt.setObjective(i, idealPoints[i]);
172180
}

0 commit comments

Comments
 (0)