Flowlessly  0.1
Minimum cost maximum cost solver
 All Classes Functions Pages
node.h
1 // The Flowlessly project
2 // Copyright (c) 2013-2016 Ionel Gog <ionel.gog@cl.cam.ac.uk>
3 
4 #ifndef FLOWLESSLY_NODE_H
5 #define FLOWLESSLY_NODE_H
6 
7 namespace flowlessly {
8 
9 // Node type is used to construct the mapping of tasks to pus.
10 // NOTE: Do not reorder types because it will affect the communication with
11 // the scheduler.
12 // OTHER is the first in the enum so that an unset type (i.e. 0) defaults
13 // to OTHER.
14 enum NodeType {
15  OTHER = 0,
16  TASK = 1,
17  PU = 2,
18  SINK = 3,
19  MACHINE = 4,
20  INTERMEDIATE_RES = 5
21 };
22 
23 enum NodeStatus {
24  NOT_VISITED = 0,
25  VISITING = 1,
26  VISITED = 2
27 };
28 
29 class Node {
30  public:
31  Node() : supply(0), potential(0), distance(0), type(NodeType::OTHER),
32  status(NodeStatus::NOT_VISITED) {
33  }
34  Node(const Node& node)
35  : supply(node.supply), potential(node.potential),
36  distance(node.distance), type(node.type), status(node.status) {
37  }
38 
39  int32_t supply;
40  int64_t potential;
41  int64_t distance; // node's distance from the source (in multiples of eps)
42  NodeType type;
43  NodeStatus status; // node's status during DFS
44 };
45 
46 } // namespace flowlessly
47 #endif // FLOWLESSLY_NODE_H
Definition: node.h:29