-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.cs
90 lines (74 loc) · 2.37 KB
/
Node.cs
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Collections.Generic;
using System.Text;
namespace testUI
{
public class Node
{
public static int nodeNumber = 0;
public List<Node> visitedNodes = new List<Node>();
private string nodeName;
private string nodeType;
public List<Node> children = new List<Node>();
public Dictionary<int, List<int>> edges = new Dictionary<int, List<int>>();
//deadEnds list stores edge indexes that leads a dead end node
public List<int> deadEnds = new List<int>();
//deadNeighbours list stores neighbours name that leads a dead end node
public List<string> deadNeighbours = new List<string>();
public List<string> neighbours = new List<string>();
private float nodeCapacity;
private float nodeCurrentFlow;
public Node()
{
nodeName = "defaultName";
nodeType = "defaultType";
nodeCapacity = 0f;
nodeCurrentFlow = 0f;
nodeNumber += 1;
}
public string getNodeType()
{
return nodeType;
}
public string getNodeName()
{
return nodeName;
}
public float getNodeCapacity()
{
return nodeCapacity;
}
public float getNodeCurrentFlow()
{
return nodeCurrentFlow;
}
public void setCurrentFlow(float flow)
{
this.nodeCurrentFlow = flow;
}
public void setNodeName(string name)
{
this.nodeName = name;
}
public void setNodeCapacity(float capacity)
{
this.nodeCapacity = capacity;
}
public void setNodeType(string type)
{
this.nodeType = type;
}
public void addChildNode(Node child)
{
children.Add(child);
Console.WriteLine(this.nodeName + " dugumune " + child.getNodeName() + " dugumum eklendi!");
}
public void addVisitedNode(Node visitedChild)
{
visitedNodes.Add(visitedChild);
Console.WriteLine(visitedChild.getNodeName() + " dugumu, " + this.nodeName + "dugumunun ziyaret edilmis dugumler listesine eklendi.");
}
}
}
//public List<int> edgesToChildren = new List<int>();
//public List<int> residualEdgesFromChildren = new List<int>();