My curriculum vitæ
- resume-cli
bash
npm install
npm run start
npm run regenerate
npm run open
A genetic algorithm searching for solutions to move a simple robot straightforward in a virtual environment
License: GNU General Public License v3.0
My curriculum vitæ
bash
npm install
npm run start
npm run regenerate
npm run open
For WritableResultModel
implement
std::ofstream &WritableResultModel::operator〈〈(std::ofstream &file, const WritableResultModel &)
Use WritableResultModel
inside void BackupDataController::_workLoop()
kind of like this
// result in a ResultModel *
WritableResultModel &json = *result;
std::ofstream file;
// ...
file << json;
Simulate the workability of WritableResultModel
in the main()
You will need to add the following attributes in ResultModel
in order to use them
class ResultModel
{
protected:
int _iteration;
int _theoreticalMaxScore;
int _maxScore;
double _averageScore;
int _worstScore;
// ...
}
Since theoreticalMaxScore
will always has the same value, we will only write it once in the file. For that we will trick a bit. If theorethicalMaxScore
is not -1
, write only this value as json, if it is -1
write all the others.
Written data must be in the form
{
"theoreticalMaxScore": 400,
"results": [
{
"iteration": 0,
"maxScore": 1,
"averageScore": 0.5,
"worstScore": 0
},
{
"iteration": 1,
"maxScore": 3,
"averageScore": 1.5,
"worstScore": 0
}
]
}
Open file on Node.js side to check that the syntax is right.
Also, implement the empty methods
ResultModel::ResultModel(const ResultModel &)
ResultModel::ResultModel(const ResultModel *)
ResultModel::ResultModel &operator=(const ResultModel &)
ResultModel::ResultModel &operator=(const ResultModel *)
Remove
ResultModel::ResultModel()
And add the following
ResultModel::ResultModel(int theoreticalMaxScore)
ResultModel::ResultModel(int iteration, int maxScore, double averageScore, int worstScore)
MainController
to GeneticAlgoController
, WebServerBridge
and BackupDataController
In GeneticAlgorithmController
class Vector
Note: Existing maths classes are
Note2: To use the libmath(s), include the library (like the pthead one in examples) in
Depends on #11
node-gyp
/library/socket.io.js
and /controller/real-time.js
Useful ressources:
Initial positions:
Make sure it still works with Archlinux and OS X
Create bool isMoving()
in _2w1a
_2w1a
inherits from Physics::Object
, use getPositionOnMap()
to get 2w1a position
in
bool GeneticAlgoController::_initializePopulation()
Depends on #11
From previous practical exercices during courses
In GeneticAlgoController, print best individual of current iteration in _emitNewResult()
Update README.md as build scripts in package.json have been updated
set y axle
, receiving as parameter an y max valueWhy ?
The y max value is the theoretical maximum score, so it's to get a full vision over the score progression
Please make a commit for each point
errorAcceptabilityRate
#ifndef FOO_HPP_
# define FOO_HPP_
#endif // !FOO_HPP_
#if
, desindented after and #endif
, like the previous # define
class
, protected
and private
members name always start with an _
underscoreclass Foo
, for an attribute int _bar
the getter/setter syntax will be
int bar() const
void setBar()
class Foo { Foo() : _bar(42) {} }
:
in an initializer listFitness
public
empty constructor and destructor in both .hpp
and .cpp
int _score
in Fitness
, initialize it at 0
at construction_score
getter and setterprivate
Fitness *_fitness
in Individual
new Fitness
in Individual
constructorspublic
Fitness &fitness()
getter in Individual
Genome
templating in Genome.hpp
public: typedef std::list<gene_t> genes_t;
struct gene_t
in Genome
, like in 2w1a pseudo code (without fake and debug prints)genes_t _genes;
by std::vector<gene_t> _genes;
gene_t &operator[](int pos)
and gene_t &operator[](unsigned int pos)
Look at class World
in World.hpp
and World.cpp
, GeneticAlgoController
inherits from it
Implement methods (empty if needed), and attributes
class GeneticAlgoController {
std::vector<Individual *> _population;
// fitness
void _rateIndividual(Individual &individual);
void _sortPopulationByScoreDesc(); // via Fitness &Individual::fitness().score();
// generate offspring
std::vector<Individual *> *_generateOffspring();
std::pair<Individual *, Individual *> _selectParents(); // pick two individuals for reproduction
Individual *_itsSexTime(std::pair<Individual *, Individual *> &parents); // generate child from parents
void _mutateChildGenome(Individual &child); // apply mutation probability
void _insertChildrenInPopulation(std::vector<Individual *> *); // in _population
// kill a part of the population
void _harshLife();
// current best solution
Individual *_bestSolution(); // from Individual::fitness().score()
}
Keep in mind that the algorithm must always work, even if you need to simulate something you don't have. Put comments where there is this kind of code.
Implement the previous methods, except _rateIndividual()
. You can get inspiration from the string finder algorithm pseudo code. Be smart while taking inspiration from this algorithm, implementation is different than 2w1a one.
WebServerBridge::Client
in WebServerBridge
with socket.io client
ResultModel
with real values in GeneticAlgoController::_algorithm()
new_iteration
socket.io event parameter is now
{ iteration: 0, maxScore: 0, averageScore: 0, worstScore: 0 }
worstScore
We can choose over multiple programming languages. V-rep makes us able to make calls to its API via the regular and remote interfaces. Here is two lists of the available languages.
Regular API:
Remote API:
http://www.coppeliarobotics.com/helpFiles/en/apisOverview.htm
I think we can eliminate the Mathlab and Urbi possibilities (any objection?). This reducing the list to:
Data monitoring and rendering is mandatory for us to be able to graphically represent the genetic algorithm. We have two possible main paths to render these data:
Redo config file as before
Remove vrep spawning code
Put a list of vrep ports in the config file (we will start vrep manually)
Send those ports to the algorithm, like previously 42042,42043,42044
The web server actually instanciate a vrep pool for running algorithm simulations inside
Our need now is to be able to display the actual best indiviual, during the algorithm run
So we will need the web server to launch an instance of vrep alongside the others
Like the others vrep instances, we need to launch this one before the algorithm started. Unlike the others, this one will run with with a graphical interface
Once this instance is started, send the port as parameter to the algorithm, in a separate field vrepDemoPort
Implement parent selection in GeneticAlgoController.cpp so that the score is considered wen selecting parents.
Create:
/config/base.json
/library/express.js
/controller/real-time.js
/controller/data-backup.js
/algorithm/cpp/
/algorithm/index.js
/server.js
(main)/routes.js
/view/index.html
Init:
package.json
for the projectserver.port
, etc.) in /config/base.json
/library/express.js
/server.js
/routes.js
Retrieve:
realTime
and dataBackup
in /server.js
/algorithm
module in /controller/real-time.js
From project subject:
Let's see what we expect from you:
WARNING!
Remember to trace EVERY STEP of your work! We will ask your captain’s log during the assessment. Be scientific!
Write a python script taking 2 series of 3 angle inputs.
Usage:
python2 [vrepPort] [wrist1] [elbow1] [shoulder1] [wrist2] [elbow2] [shoulder2]
Describe the first implementation of our genetic algorithm in pseudo code
Useful ressources:
Parameters :
master
rulesmaster
Use the vrep pool (see #55)
MVC classico ? Something more custom ? Will depend of the logic we choose to implement ( #2 )
Depends on #14
/README.md
/sample_code/README.md
Select needed and useful data to:
2w1a.ttt
scene4000,4001,4002
vrepPool
Usefull: http://www.coppeliarobotics.com/helpFiles/en/commandLine.htm
Note: The scene path must be the full path
in
GeneticAlgoController::_emitTheoreticalMaxScore();
GeneticAlgoController::_emitNewResult();
GeneticAlgoController::_emitSolutionFound();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.