Exemple #1
0
 def generateRandom(self):
     ## first do as if File->New was selected
     self.new()
     ## then show randomProblemDialog
     #ui = Ui_randomProblemDialog()
     #dialog = QtDialog()
     ## create random problem
     (numpoints, ratio, size, rounding) = (10, 0.0, 100.0, 0.0)
     problem = randomproblem.random_triangular_problem_3D(numpoints, size, rounding, ratio)
     prototypeManager = PrototypeManager()
     prototypeManager.setProblem(problem)
     self.viewportManager.updateViewports()
Exemple #2
0
def stats_solving(minsize, maxsize, repeats):
    print "times for solving problems from scratch"
    print "size \t # \t time \t result"
    for size in range(minsize, maxsize + 1):
        for i in range(1, repeats + 1):
            problem = random_triangular_problem_3D(size, 10.0, 0.0, 0.0)
            t1 = time()
            solver = GeometricSolver(problem)
            result = solver.get_status()
            t2 = time()
            t = t2 - t1
            print size, "\t", i, "\t", t, "\t", result
Exemple #3
0
 def generateRandom(self):
     ## first do as if File->New was selected
     self.new()
     ## then show randomProblemDialog
     #ui = Ui_randomProblemDialog()
     #dialog = QtDialog()
     ## create random problem
     (numpoints, ratio, size, rounding) = (10, 0.0, 100.0, 0.0)
     problem = randomproblem.random_triangular_problem_3D(numpoints, size, rounding, ratio)
     prototypeManager = PrototypeManager()
     prototypeManager.setProblem(problem)
     self.viewportManager.updateViewports()
def stats_solving(minsize, maxsize, repeats):
    print "times for solving problems from scratch"
    print "size \t # \t time \t result"
    for size in range(minsize,maxsize+1):
        for i in range(1,repeats+1):
            problem = random_triangular_problem_3D(size,10.0,0.0,0.0)
            t1 = time()
            solver = GeometricSolver(problem)
            result = solver.get_status()
            t2 = time()
            t = t2-t1
            print size,"\t",i,"\t",t,"\t",result
Exemple #5
0
def stats_parametric(minsize, maxsize, repeats):
    #diag_select("clsolver.remove")
    print "times for parameteric updates (one constraint parameter)"
    print "size \t # \t time \t result"
    for size in range(minsize, maxsize + 1):
        for i in range(1, repeats + 1):
            problem = random_triangular_problem_3D(size, 10.0, 0.0, 0.0)
            solver = GeometricSolver(problem)
            constraint = random.choice(problem.cg.constraints())
            t1 = time()
            constraint.set_parameter(constraint.get_parameter())
            result = solver.get_status()
            t2 = time()
            t = t2 - t1
            print size, "\t", i, "\t", t, "\t", result
def stats_parametric(minsize, maxsize, repeats):
    #diag_select("clsolver.remove")
    print "times for parameteric updates (one constraint parameter)"
    print "size \t # \t time \t result"
    for size in range(minsize,maxsize+1):
        for i in range(1,repeats+1):
            problem = random_triangular_problem_3D(size,10.0,0.0,0.0)
            solver = GeometricSolver(problem)
            constraint = random.choice(problem.cg.constraints())
            t1 = time()
            constraint.set_parameter(constraint.get_parameter())
            result = solver.get_status()
            t2 = time()
            t = t2-t1
            print size,"\t",i,"\t",t,"\t",result
Exemple #7
0
def stats_incremental(minsize, maxsize, repeats):
    #diag_select("clsolver.remove")
    print "times for incremental re-solving (one constraint removed and re-added)"
    print "size \t # \t time \t result"
    for size in range(minsize, maxsize + 1):
        for i in range(1, repeats + 1):
            problem = random_triangular_problem_3D(size, 10.0, 0.0, 0.0)
            solver = GeometricSolver(problem)
            t1 = time()
            constraint = random.choice(problem.cg.constraints())
            problem.rem_constraint(constraint)
            problem.add_constraint(constraint)
            result = solver.get_status()
            t2 = time()
            t = t2 - t1
            print size, "\t", i, "\t", t, "\t", result
def stats_incremental(minsize, maxsize, repeats):
    #diag_select("clsolver.remove")
    print "times for incremental re-solving (one constraint removed and re-added)"
    print "size \t # \t time \t result"
    for size in range(minsize,maxsize+1):
        for i in range(1,repeats+1):
            problem = random_triangular_problem_3D(size,10.0,0.0,0.0)
            solver = GeometricSolver(problem)
            t1 = time()
            constraint = random.choice(problem.cg.constraints())
            problem.rem_constraint(constraint)
            problem.add_constraint(constraint)
            result = solver.get_status()
            t2 = time()
            t = t2-t1
            print size,"\t",i,"\t",t,"\t",result