-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphConnection.py
51 lines (32 loc) · 1.21 KB
/
GraphConnection.py
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
from GraphNode import GraphNode
class GraphConnection():
def __init__(self, n1, n2, weight=0):
self.start = n1
self.end = n2
self.startID = 0
self.endID = 0
self.weight = weight
def get_start_node(self):
'''Returns the starting node.'''
return self.start
def get_end_node(self):
'''Returns the ending node.'''
return self.end
def get_start_position(self):
'''Returns the starting position of the connection.'''
return self.start.get_position()
def get_end_position(self):
'''Returns the ending position of the connection.'''
return self.end.get_position()
def get_startID(self):
'''Returns startID.'''
return self.startID
def get_endID(self):
'''Returns endID.'''
return self.endID
def set_startID(self, ID):
'''Sets start ID so that the manager can more quickly calculate connection forces.'''
self.startID = ID
def set_endID(self, ID):
'''Sets end ID so that the manager can more quickly calculate connection forces.'''
self.endID = ID