+/GENN

genetically evolving neural networks

git clone https://git.julia.blue/+/GENN

Joseph RyanUpdate Readmea43321c

imdone-todo-updates
699 B36 linesraw
1#ifndef GENN_POLE_H
2#define GENN_POLE_H
3
4#include "../include/Simulation.h"
5#include "../lib/tigr.h"
6
7class Pole : public Simulation {
8private:
9    Tigr *screen;
10    int width = 500, height = 200;
11    double fps = 1. / 30;
12    double accumulator = 0;
13    int cartWidth = 40, cartHeight = 10;
14    double pi = 3.14159265358979323846;
15    double length = 10, angle = 0, angleSpeed = 0, maxForce = 10, cart =
16            width / 2, speed = 0;
17    double massCart = .9, massPole = .1, g = 9.8;
18
19    bool step(double);
20
21    void reset();
22
23public:
24    Pole() {
25        controller = new NEAT(5, 1);
26    }
27
28    void play();
29
30    void evaluate(Genome &g);
31
32    void view(Network n);
33};
34
35
36#endif //GENN_POLE_H