Explorar el Código

Added csp solver initial implementation

Federico Amedeo Izzo hace 9 años
padre
commit
a2a1b4f54f
Se han modificado 1 ficheros con 32 adiciones y 0 borrados
  1. 32 0
      csp_solver.py

+ 32 - 0
csp_solver.py

@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+from sudoku import Game, printBoard, setValue, getBoard
+
+MAX_V = 10
+
+class Solver:
+    def __init__(self):
+        self.tree = {}
+        choices = set()
+        board = []
+        # Populate the choice vector with values from 0 to MAX_V-1
+        for x in range(MAX_V)
+            choices.add(str(x))
+        # Creates a bidimensional list with choices for every element
+        for x in range(MAX_V):
+            row = []
+            for y in range(MAX_V):
+                row.append(choices)
+            board.append(row)
+        self.board = board
+        result = getBoard()
+
+    def actions(state):
+
+    def result(state,action):
+
+    def goalTest(state):
+
+if __name__ == "__main__":
+    while not goalTest(state):
+        for action in actions(node):