Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import argv
- import os
- script, variable, constraint, consistency = argv
- """variableFile = open(variable, "r")
- constraintFile = open(constraint, "r")
- consistencyFile = open(consistency, "r")
- d = {}
- varList = variableFile.read()
- varList = varList.replace(" ", "")
- varList = varList.replace(":", "")
- for line in varList:
- (key, val) = line.split()
- d[str(key)] = val
- print(varList)
- """
- with open(variable, 'r') as variableFile:
- answer = {}
- varNum = sum(1 for line in open(variable))
- for x in range(1, varNum):
- line = variableFile.readline()
- line = line.replace(':', '')
- line = line.split()
- if not line:
- continue
- answer[line[0]] = line[1:]
- #print(variableFile.read())
- #answer = answer.replace(":", "")
- print(answer)
- with open(constraint, 'r') as constraintFile:
- print(constraintFile.read())
- with open(consistency, 'r') as consistencyFile:
- print(consistencyFile.read())
- """def backtrack_search(csp):
- return recursive-backtrack({}, csp)
- def recursive_backtrack(assignment, csp):
- if (assignment == complete): return assignment
- variable = select_unassigned_variable(Variable[csp], assignment, csp)
- return solution"""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement