Commit c2055707 authored by Romain Reuillon's avatar Romain Reuillon
Browse files

[Plugin] enh: fix objective type

parent f32b556f
Pipeline #1225 passed with stages
in 38 minutes and 35 seconds
......@@ -99,14 +99,14 @@ object AnalysisData {
object NSGA2 {
case class Generation(generation: Long, genome: Vector[Vector[GenomeData]], objective: Vector[Objective]) extends AnalysisData.Generation
case class Objective(objectives: Vector[ObjectiveData])
case class Objective(objectives: Vector[Double])
case class Convergence(nadir: Option[Vector[Double]], generations: Vector[GenerationConvergence]) extends AnalysisData.Convergence
case class GenerationConvergence(generation: Long, hypervolume: Option[Double], minimums: Option[Vector[Double]])
}
object StochasticNSGA2 {
case class Generation(generation: Long, genome: Vector[Vector[GenomeData]], objective: Vector[Objective]) extends AnalysisData.Generation
case class Objective(objectives: Vector[ObjectiveData], samples: Int)
case class Objective(objectives: Vector[Double], samples: Int)
case class Convergence(nadir: Option[Vector[Double]], generations: Vector[GenerationConvergence]) extends AnalysisData.Convergence
case class GenerationConvergence(generation: Long, hypervolume: Option[Double], minimums: Option[Vector[Double]])
}
......
......@@ -72,9 +72,9 @@ object Analysis {
def loadFile(metaData: EvolutionMetadata.NSGA2, f: File) = {
val json = parse(f.content(gz = true)).right.get.asObject.get
def objectives: Vector[Vector[ObjectiveData]] =
def objectives: Vector[Vector[Double]] =
metaData.objective.toVector.map {
o json(o.name).get.asArray.get.map(_.toString)
o json(o.name).get.asArray.get.map(_.as[Double].toOption.get)
}.transpose
def genomes =
......@@ -159,9 +159,9 @@ object Analysis {
def loadFile(metaData: EvolutionMetadata.StochasticNSGA2, f: File) = {
val json = parse(f.content(gz = true)).right.get.asObject.get
def objectives: Vector[Vector[ObjectiveData]] =
def objectives: Vector[Vector[Double]] =
metaData.objective.toVector.map {
o json(o.name).get.asArray.get.map(_.toString)
o json(o.name).get.asArray.get.map(_.as[Double].toOption.get)
}.transpose
def genomes =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment