-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractAlgorithm.h
More file actions
29 lines (21 loc) · 935 Bytes
/
AbstractAlgorithm.h
File metadata and controls
29 lines (21 loc) · 935 Bytes
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
#ifndef __ABSTRACT_ALGORITHM__H_
#define __ABSTRACT_ALGORITHM__H_
#include <map>
using namespace std;
#include "AbstractSensor.h"
class AbstractAlgorithm
{
public:
virtual ~AbstractAlgorithm() {}
// setSensor is called once when the Algorithm is initialized
virtual void setSensor(const AbstractSensor& sensor) = 0;
// setConfiguration is called once when the Algorithm is initialized - see below
virtual void setConfiguration(map<string, int> config) = 0;
// step is called by the simulation for each time unit
virtual Direction step(Direction prevStep) = 0;
// this method is called by the simulation either when there is a winner or
// when steps == MaxSteps - MaxStepsAfterWinner
// parameter stepsTillFinishing == MaxStepsAfterWinner
virtual void aboutToFinish(int stepsTillFinishing) = 0;
};
#endif //__ABSTRACT_ALGORITHM__H_