-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaseDriver.h
57 lines (42 loc) · 1.73 KB
/
BaseDriver.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
/***************************************************************************
file : BaseDriver.h
copyright : (C) 2007 Daniele Loiacono
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef BASEDRIVER_H_
#define BASEDRIVER_H_
#include<iostream>
#include "phenotype.h"
using namespace std;
class BaseDriver
{
public:
typedef enum{WARMUP,QUALIFYING,RACE,UNKNOWN} tstage;
tstage stage;
char trackName[100];
// Default Constructor
BaseDriver(){};
// Default Destructor;
virtual ~BaseDriver(){};
// Initialization of the desired angles for the rangefinders
virtual void init(float *angles){
for (int i = 0; i < 19; ++i)
angles[i]=-90+i*10;
};
// The main function:
// - the input variable sensors represents the current world sate
// - it returns a string representing the controlling action to perform
virtual string drive(string sensors, CNeuralNet* brain)=0;
// Callback function called at shutdown
virtual void onShutdown(){};
// Callback function called at server restart
virtual void onRestart(){};
};
#endif /*BASEDRIVER_H_*/