-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworld.h
More file actions
52 lines (40 loc) · 1.04 KB
/
world.h
File metadata and controls
52 lines (40 loc) · 1.04 KB
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
#ifndef WORLD_H
#define WORLD_H
#include <QMap>
#include "automaton.h"
#include <time.h>
#include <iostream>
#include "boost/random.hpp"
#define ANT_SEARCH 1
#define BASE 2
#define FOOD 3
#define ANT_SEARCH2 4
#define ANT_SEARCH3 5
#define ANT_RETURN 6
#define PHERO_SEARCH 7
#define PHERO_SEARCH2 8
#define PHERO_RETURN 9
#define BASE_EMPTY 10
#define BASE_EXPEND 11
#define IN_BASE 12
class World
{
public:
World(){}
World(QPair<int,int>, QVector<QPair<int, int> > N, QVector<int> **);
World(int, int, QVector<QPair<int, int> > N, QVector<int> **);
void nextStep();
void reset();
QPair<int,int> neighboorCoord(Automaton, int, QPair<int, int>);
Automaton getAutomaton(int,int);
QMap<QPair<int,int>,Automaton>& getAutomata();
private:
QPair<int,int> size;
QMap<QPair<int,int>,Automaton> automata;
void transitionFunction(QMap<QPair<int,int>,Automaton>&, QPair<int, int> coord);
boost::random::mt19937 random;
int nbrofAnt=0;
int nbrofDead = 0;
int nbrofPhero = 0;
};
#endif // WORLD_H