-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHandler.h
More file actions
68 lines (53 loc) · 1.68 KB
/
Handler.h
File metadata and controls
68 lines (53 loc) · 1.68 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
Archive: node.h
Author: Diego Fabián Ledesma Motta
code: 1928161
email: diego.ledesma@correounivalle.edu.co
*/
#ifndef HANDLER_HH
#define HANDLER_HH
#include <iterator>
#include <list>
#include <chrono>
#include <vector>
#include "Node.h"
class Handler{
private:
Node rootNode;
std::list <Node *> l;
bool victory;
std::list <Node> nodeRegistry;
int minCost;
std::vector <Node*> solutionPath;
int victorysize;
std::chrono::microseconds solutionTime;
int numberOfExpansions;
public:
Handler(Node rootNode);
Handler(Node fn, int _initialRobotPosition[2], int _shipsFuel[2], bool _foundItems[2],
bool _drivingShip[2]);
bool expansion0(Node* expNode); //best for breadthFirstSearch.
bool expansion1(Node* expNode); //best for uniformCostSearch.
bool expansion2(Node* expNode); //best for depthFirstSearch & greedySearch.
bool expansion3(Node* _expNode); //best for A*
void search(int mode);
void breadthFirstSearch();
void uniformCostSearch();
void depthFirstSearch();
void greedySearch(); //best-first search
void aAsteriscSearch();
Node* getFront();
void printWay(Node* _node);
void makeWay(Node* _vicNode);
void showValsL(std::list<Node *> lst);
void showValsNodeRegistry(std::list<Node> lst);
Node* getVicWayNode(int position);
int getVictorySize();
int getSolutionTime();
int getRobotsPosition0(int posNode);
int getRobotsPosition1(int posNode);
int getNumberOfExpansions();
};
#else
class Handler;
#endif