EvoRobSim

Fra Robin

Gå til: navigasjon, søk

Innhold

Evolutionary run

How to start an evolutionary run

In debug mode

  • set vc_solution as startup project
  • command arguments: hox-evolution debug (or yourname-evolution)
  • working dir: ../..
  • copy data/ into Debug/
  • launch vc_solution in debug mode
  • launch a debug instance of sim_worker_display (and possibly more sim_workers)

In experiment mode

  • make file seeds.txt and fill with random numbers from random.org, format one column
  • copy vc_solution.exe and sim_worker(_display).exe to root folder of project
  • start vc_solution.exe yourname-evolution
  • start a number of sim_worker.exe and a sim_worker_display.exe for visualization. Optionally start sim_slave.exe which will launch sim_workers.

Using a network of computers

After compiling the solution:

  • On the server, run vc_solution.exe with the evolution manager name as first parameter
  • On every client, run sim_slave.exe with the server name/address as first parameter
  • Press any key on the server when ready to start the runs

How to implement your own evolutionary setup and robot

How to implement an evolutionary control/harness/run

Fil:Server uml.png

This part needs some update on VanillaEvolution

Customize means to make your own subclass which contains your specific functionality

  • Make a custom EvolutionManager with evolutionary setup (the run() method can load a config file which specifies the objectives)
  • Possibly make your own evaluation critera by customizing SimEvaluator
  • Customize EvorobScenario for setting up the simulation environment, like obstacles etc.

How to define your own simulated robot

  • Make a custom Blueprint which is a simulator/hardware-independent description of the robot
    • Implement a MyBlueprint::generateMachine method which generates a custom Machine (a simulator description of the robot)
    • File structure:
      • my_blueprint.h - contains the MyBlueprint class description
      • my_blueprint.cpp - contains the general implementation of MyBlueprint including serialization
      • my_blueprint_machine.cpp - contains the simulator-specific implementation of MyBlueprint, MyBlueprint::generateMachine - for the sim_worker / sim_worker_display / bbp_viewer projects
      • my_blueprint_nomachine.cpp - contains a dummy implementation of MyBlueprint::generateMachine - for the vc_solution project
  • Make a custom RobotGenes which contains a description of the genes and how to mutate them

Evaluation client overview

Fil:Scenario_evaluation.png

How to select and define your own objectives

  • Make a custom SimEvaluator which is an evaluator class containing the functions onInclusion and onSimulationStep.
    • Register the class in the rtti system with a name starting with eval-
    • Implement the needed function and write the fitness value to _score. Return true to continue simulation, and false to stop simulating the current solution.
  • Include the new evaluator by adding it to your config file

How to define and use a scenario (e.g. some objects on your infinite plane)

  • ...

How to use your results

How to see the results in the bbp_viewer

    • Make sure you have code for dumping the bbp files in your extension of EvolutionManager
    • Include the source code for your robot and blueprint in bbp_viewer
    • Launch bbp_viewer.exe your_blueprint.bbp

How to plot some stats from the runs

A simple example for matlab is included below:

   files = dir('*.txt');
   fitness = zeros(length(files),1);
   for i = 1:length(files)
       files(i).content = load(files(i).name);
       fitness(i) = mean(files(i).content(:,1));
   end
   plot(fitness);

remaining topics

  • overføre resultat til virkelig robot
  • mulig å ha ett frittstående / fryst eksempel som kjører evolusjon (og hvordan kjør) og gjør det mulig å overføre?
  • Egne fitnessfunksjoner / scenario
  • Hvordan legge over .stl filer
  • Hvordan dumpe bildesekvens fra viewer som man kan lage video fra
Personlige verktøy