I want to use the MOEA framework in my Kotlin/IntelliJ project on OS X 10.15.
I downloaded the compiled binaries from: https://github.com/MOEAFramework/MOEAFramework/releases/download/v2.12/MOEAFramework-2.12.tar.gz and added the *.jar files as library to my Kotlin project. Than I converted one java file out of the examples folder to a Kotlin file and tried to compile it.
I get this error message: Unresolved reference: moeaframework
After I added the MOEA lib files I see that this lib is available in the IDE and the lib is referenced correctly, but unfortunately I can’t build the project.
This is the converted Kotlin example file:
import org.moeaframework.Executor
import org.moeaframework.core.NondominatedPopulation
import org.moeaframework.core.Solution
object Example1 {
@JvmStatic
fun main(args: Array<String>) {
//configure and run this experiment
val result = Executor()
.withProblem("UF1")
.withAlgorithm("NSGAII")
.withMaxEvaluations(10000)
.run()
//display the results
System.out.format("Objective1 Objective2%n")
for (solution in result) {
System.out.format(
"%.4f %.4f%n",
solution.getObjective(0),
solution.getObjective(1)
)
}
}
}
The lib is also available in Project Settings / Libraries
I use JDK 13.0.1
JVM 1.8