-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent.h
52 lines (42 loc) · 848 Bytes
/
agent.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
#ifndef AGENT_H
#define AGENT_H
#include "common.h"
#define ACT_TS 0 //task start
#define ACT_TF 1 //task finish
#define ACT_MS 2 //movement start
#define ACT_MF 3 //movement finish
struct Action
{
int type; //TS, TF, MS, MF
int occurance_time;
int order;
string target;
};
struct Status
{
string task;
string position;
vector<int> tasks_status;
int iteration;
};
/* An agent that moves and performs tasks
*/
class Agent
{
public:
Agent();
explicit Agent(int id_v);
~Agent();
int id;
void add_state(Status s);
vector<Status> get_states();
queue<Action> get_actions();
void add_action(Action a);
Action get_next_action();
void pop_action();
private:
vector<Status> state_list;
queue<Action> action_queue;
};
string getActionType(Action a);
#endif