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

exp-examples.point-nav.txt Maven / Gradle / Ivy

The newest version!
ea.experiment(
  runs = (randomGenerator = (seed = [1]) * [m.defaultRG()]) *
    (problem = [
        ea.p.numEnvTo(environment = ds.e.pointNavigation(arena = E_MAZE; robotMaxV = 0.05); f = ds.e.n.minD(); finalT = 10)
      ]) *
      (solver = (nEval = [2000]) * [
        ea.s.mapElites(
          name = "me-ne-10-4";
          representation = ea.r.doubleString();
          mapper = ea.m.dsToNpnds(npnds = ds.num.mlp(innerLayerRatio = 10; nOfInnerLayers = 4));
          nPop = 50;
          descriptors = [
            ea.s.me.d.descriptor(f = ds.e.n.x(of = ds.e.n.finalRobotP(of = ea.f.simOutcome(of = ea.f.quality()))));
            ea.s.me.d.descriptor(f = ds.e.n.y(of = ds.e.n.finalRobotP(of = ea.f.simOutcome(of = ea.f.quality()))))
          ]
        );
        ea.s.mapElites(
          name = "me-ne-2-2";
          representation = ea.r.doubleString();
          mapper = ea.m.dsToNpnds(npnds = ds.num.mlp(innerLayerRatio = 2; nOfInnerLayers = 2));
          nPop = 50;
          descriptors = [
            ea.s.me.d.descriptor(f = ds.e.n.x(of = ds.e.n.finalRobotP(of = ea.f.simOutcome(of = ea.f.quality()))));
            ea.s.me.d.descriptor(f = ds.e.n.y(of = ds.e.n.finalRobotP(of = ea.f.simOutcome(of = ea.f.quality()))))
          ]
        );
        ea.s.mapElites(
          name = "me-mtgp";
          representation = ea.representation.multiSRTree();
          mapper = ea.mapper.nmrfToNds(of = ea.mapper.multiSrTreeToNmrf());
          nPop = 50;
          descriptors = [
            ea.s.me.d.descriptor(f = ds.e.n.x(of = ds.e.n.finalRobotP(of = ea.f.simOutcome(of = ea.f.quality()))));
            ea.s.me.d.descriptor(f = ds.e.n.y(of = ds.e.n.finalRobotP(of = ea.f.simOutcome(of = ea.f.quality()))))
          ]
        )
      ]) * [
      ea.run()
  ];
  listeners = [
    ea.l.console(
      functions = [
        ea.f.size(of = ea.f.genotype(of = ea.f.best()); format = "%3d");
        ea.f.simQuality(of = ea.f.quality(of = ea.f.best()); format = "%9.5f");
        ea.f.meBin(of = f.nTh(of = ea.f.meCoordinates(of = ea.f.best()); n = 0));
        ea.f.meBin(of = f.nTh(of = ea.f.meCoordinates(of = ea.f.best()); n = 1));
        ea.f.meValue(of = f.nTh(of = ea.f.meCoordinates(of = ea.f.best()); n = 0));
        ea.f.meValue(of = f.nTh(of = ea.f.meCoordinates(of = ea.f.best()); n = 1));
        ea.f.id(of = ea.f.best());
        f.nTh(of = ea.f.parentIds(of = ea.f.best()); n = 0)
      ];
      onlyLast = true
    );
    ea.l.lastPopulationSaver(
      filePathTemplate = "../last-pop-{solver.name}-{randomGenerator.seed:%04d}"
    );
    ea.l.runSaver(
      filePathTemplate = "../best-traj-{solver.name}-{randomGenerator.seed:%04d}";
      of = ea.acc.lastBest();
      processors = [ea.f.toImage(image = ds.d.pointNavigation(); of = ea.f.simOutcome(of = ea.f.quality()))]
    );
    ea.l.runSaver(
      filePathTemplate = "../trajs-{solver.name}-{randomGenerator.seed:%04d}";
      of = ea.acc.bests();
      processors = [ea.f.toImagesVideo(image = ds.d.pointNavigation(); of = f.each(mapF = ea.f.simOutcome(of = ea.f.quality())))]
    );
    ea.l.runSaver(
      filePathTemplate = "../best-video-{solver.name}-{randomGenerator.seed:%04d}";
      of = ea.acc.lastBest();
      processors = [ea.f.toVideo(video = ea.misc.toVideo(drawer = ds.d.pointNavigation()); of = ea.f.simOutcome(of = ea.f.quality()))]
    );
    ea.l.runSaver(
      filePathTemplate = "../best-field-{solver.name}-{randomGenerator.seed:%04d}";
      of = ea.acc.lastBest();
      processors = [ea.f.toImage(image = ds.d.vectorField(arena = E_MAZE); of = ea.f.solution())]
    );
    ea.l.runPlotSaver(
      filePathTemplate = "../archives-point-nav-{solver.name}-{randomGenerator.seed:%04d}";
      of = ea.plot.single.me(values = [ea.f.simQuality(of = ea.f.quality())]);
      condition = predicate.all(conditions = [
        predicate.inS(f = ea.f.runString(s = "{randomGenerator.seed}"); values = ["1"])
      ])
    );
    ea.l.runPlotSaver(
      filePathTemplate = "../archives-point-nav-{solver.name}-{randomGenerator.seed:%04d}";
      of = ea.plot.single.me(values = [ea.f.simQuality(of = ea.f.quality())]; condition = predicate.ltEq(t = 1));
      processors = [ea.f.videoPlotter()];
      condition = predicate.all(conditions = [
        predicate.inS(f = ea.f.runString(s = "{randomGenerator.seed}"); values = ["1"])
      ])
    );
    ea.l.expPlotSaver(
      filePath = "../point-nav-fitness";
      processors = [ea.f.imagePlotter(); ea.f.csvPlotter()];
      of = ea.plot.multi.quality(y = ea.f.simQuality(of = ea.f.quality(of = ea.f.best())))
    )
  ]
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy