-
Notifications
You must be signed in to change notification settings - Fork 1
/
sipp_node.h
28 lines (20 loc) · 830 Bytes
/
sipp_node.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
#ifndef SIPP_NODE_H
#define SIPP_NODE_H
#include "node.h"
struct SIPPNode : virtual public Node
{
int startTime;
int endTime;
SIPPNode(int x = 0, int y = 0, Node *p = nullptr, int g_ = 0, int H_ = 0, int ConflictsCount = 0, int hc_ = 0) :
Node(x, y, p, g_, H_, ConflictsCount), startTime(g_), endTime(g_) {}
SIPPNode(const Node &other) : Node(other) {}
virtual int convolution(int width, int height, bool withTime = true) const {
int res = withTime ? width * height * startTime : 0;
return res + i * width + j;
}
bool operator< (const SIPPNode &other) const {
return std::tuple<int, int, int, int, int>(F, -g, -startTime, i, j) <
std::tuple<int, int, int, int, int>(other.F, -other.g, -other.startTime, other.i, other.j);
}
};
#endif