-
Notifications
You must be signed in to change notification settings - Fork 0
/
CCar.h
61 lines (41 loc) · 1.12 KB
/
CCar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef CCAR_H
#define CCAR_H
//------------------------------------------------------------------------
//
// Name: CCar.h
//
// Author: Morten Schnack 2013 ([email protected])
//
// Desc: Class to create a car object
//
//------------------------------------------------------------------------
#include <vector>
#include <math.h>
#include "phenotype.h"
#include "CParams.h"
using namespace std;
class CCar
{
private:
// its brain
CNeuralNet* m_pItsBrain;
//to store output from the ANN
double m_leftRightTrack, m_brakeAccelerateTrack;
//the car's fitness score.
double m_dFitness;
public:
CCar();
//updates the ANN with information from the car enviroment
bool Update(vector<SPoint> &objects);
void Reset();
void EndOfRunCalculations();
void RenderStats(HDC surface);
void DrawNet(HDC &surface, int cxLeft, int cxRight, int cyTop, int cyBot)
{
m_pItsBrain->DrawNet(surface, cxLeft, cxRight, cyTop, cyBot);
}
//-------------------accessor functions
float Fitness()const{return m_dFitness;}
void InsertNewBrain(CNeuralNet* brain){m_pItsBrain = brain;}
};
#endif