Exemple #1
0
def runTen():
    vals = []
    for i in range(10):
        problem = EightQueens()
        vals.append(mc.min_conflicts(problem, False))
    total = 0
    average = 0
    for val in vals:
        if val is not None:
            average += val
            total += 1
    average = average / total
    print "Attempted 10 8-Queens problems"
    print "Results:", vals
    print total, "8-Queens problems solved in an average of", average, "steps."
Exemple #2
0
def runThree():
    for i in range(3):
        problem = EightQueens()
        mc.min_conflicts(problem, True)
Exemple #3
0
def runThree():
    for i in range(3):
        problem = ClassScheduling()
        mc.min_conflicts(problem, True)