-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathtask.h
35 lines (32 loc) · 971 Bytes
/
task.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
#ifndef TASK_H
#define TASK_H
#include <iostream>
#include <string>
#include <algorithm>
#include <sstream>
#include <vector>
#include "tinyxml2.h"
#include "structs.h"
#include "const.h"
#include <fstream>
#include "map.h"
class Task
{
private:
std::vector<Agent> agents;
public:
bool get_task(const char* FileName, int k=-1);
unsigned int get_agents_size() const { return agents.size(); }
void make_ids(int width);
void make_ij(const Map &map);
Agent get_agent(int id) const;
void print_task()
{
//for(int i=0; i<agents.size(); i++)
// std::cout<<i<<","<<agents[i].start_i<<","<<agents[i].start_j<<","<<agents[i].goal_i<<","<<agents[i].goal_j<<"\n";
for(auto agent:agents)
std::cout<<"<agent start_i=\""<<agent.start_i<<"\" start_j=\""<<agent.start_j<<"\" goal_i=\""<<agent.goal_i<<"\" goal_j=\""<<agent.goal_j<<"\"/>\n";
}
Task();
};
#endif // TASK_H