-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.py
More file actions
33 lines (24 loc) · 808 Bytes
/
Copy pathnode.py
File metadata and controls
33 lines (24 loc) · 808 Bytes
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
from random import randint
class Node:
def __init__(self, from_cell, to_here_cell, board):
self.children = []
self.utility = 0
self.decisionChild = None
self.from_cell = from_cell
self.to_here_cell = to_here_cell
self.board = board
def setChild(self, child):
self.children.append(child)
def setUtility(self, utility):
self.utility = utility
def setDecisionChild(self, decisionChild):
self.decisionChild = decisionChild
def getDecisionChild(self):
return self.decisionChild
def getFromCell(self):
return self.from_cell
def getToCell(self):
return self.to_here_cell
def setEvaluationFunction(self):
evaluation = randint(-100, 100)
self.utility = evaluation