All Downloads are FREE. Search and download functionalities are using the official Maven repository.

exp-examples.bitstring-onemax.txt Maven / Gradle / Ivy

The newest version!
ea.experiment(
  runs =
    (randomGenerator = (seed = [1:1:5]) * [m.defaultRG()]) *
    (solver = (nEval = [5000]) *
    (representation = [ea.r.bitString()]) * [
      ea.s.mapElites(descriptors = [
        ea.s.me.d.descriptor(f = f.avg(of = f.nkTh(of = ea.f.toDoubleString(of = ea.f.genotype()); n = 3; k = 0)));
        ea.s.me.d.descriptor(f = f.avg(of = f.nkTh(of = ea.f.toDoubleString(of = ea.f.genotype()); n = 3; k = 1)))
      ]);
      ea.s.ga()
    ]) * (problem = (p = [10; 50]) * [ea.p.s.oneMax()]) * [ea.run()];
  listeners = [
    ea.l.console(
      functions = [
        ea.f.size(of = ea.f.genotype(of = ea.f.best()); format = "%3d");
        ea.f.quality(of = ea.f.best(); format = "%6.4f");
        ea.f.hist(of = f.each(of = ea.f.all(); mapF = ea.f.quality()));
        f.percentile(of = f.each(of = ea.f.all(); mapF = ea.f.quality()); p = 75; format = "%6.4f");
        ea.f.solution(of = ea.f.best(); format = "%60.60s")
      ];
      runFunctions = [ea.f.runKey(key = "run.problem.p")];
      onlyLast = true
    );
    ea.l.savePlotForExp(
      path = "../{name}-fitness";
      plot = ea.plot.multi.quality()
    );
    ea.l.savePlotForExp(
      path = "../{name}-final-fitness";
      plot = ea.plot.multi.qualityBoxplot()
    )
  ]
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy