def generate_formula(category, number, dimension):
    formulas = formula.Formulas()
    for i in range(number):
        if (category == formula.POLYNOMIAL):
            f = generate_polynomial(category, dimension)
            formulas.put(category, f)
        elif (category == formula.POLYHEDRON):
            f = generate_polyhedron(category, dimension)
            formulas.put(category, f)

    return formulas
Пример #2
0
def generate_formulas():
    formulas = formula.Formulas()
    formu0 = formula.Formula(
        [[[0, 0]], [500]], formula.POLYHEDRON)
    # [[[-571, 31]], [445]], formula.POLYHEDRON)
    # [[[0, 0]], [500]], formula.POLYHEDRON)
    formulas.put(formu0.get_category(), formu0)
    # formulas.put([[[12,0],[-12,0]],[4,4]])

    formu1 = formula.Formula(
        [[[500, 0]], [100]], formula.POLYHEDRON)
    formulas.put(formu1.get_category(), formu1)
    return formulas
Пример #3
0
def generate_specific_formula():
    formulas = formula.Formulas()
    formu = formula.Formula(
        # [[[-2, 60], [163, -899]], [485, 430]], formula.POLYHEDRON)
        # [[[-700, -700], [700, 700]], [300, 300]], formula.POLYHEDRON)
        [[[0, 0]], [500]],
        formula.POLYHEDRON)
    # [[[-571, 31]], [445]], formula.POLYHEDRON)
    # [[[0, 0]], [500]], formula.POLYHEDRON)
    formulas.put(formu.get_category(), formu)
    # formulas.put([[[12,0],[-12,0]],[4,4]])

    return formulas
def generate_specific_formula():
    formula_list = formula.Formulas()
    formu = formula.Formula(
        # [[[-2, 60], [163, -899]], [485, 430]], formula.POLYHEDRON)
        # [[[-700, -700], [700, 700], [-700, 700], [700, -700]], [300, 300, 300, 300]], formula.POLYHEDRON)
        # [[[-271, 95], [597, -840]], [423, 446]], formula.POLYHEDRON)
        [[[-430, 783], [100, 924], [-965, 489]], [485, 436, 435]],
        formula.POLYHEDRON)
    # [[[541, 133, -249, 364, 961], [-283, -165, -430, -849, -136]], [444, 429]], formula.POLYHEDRON)
    # [[-2, 0, -4, 1], [-5, 3, 4], [5, -2, 5], [-4, 5, -5], [1, -3, -3, 1], [1, -4], [-5, 5, 0, -2], [2, 4, -3, -5], [-4, 5, 5, -2], [1, 3, -3], [-1, 0], [-5], [-2, 2, 3], [3], [-5, 1], [-5, -3, -3, -2], [-1], [4, 3, -1, -4], [-2, 0, 2, -4], [1, 4, 0, 4], [-1, 5], [-1], [-1], [-4, -2, -4], [-1], [2], [4, 1, 1], [1, -4, 3, 0], [5, 0], [-3], [-5], [1], [4, 5], [-3], [-1, 0], [0, 1], [3, 4], [-2, 0, 2], [5, 5], [2, 0, -3], [1], [3, -1, 2, -4], [-1, 3, -2], [1, 3, 3], [-2, -2, -3, 2], [-3], [0, -5, -5], [3, -4], [-4, -3, 5, -1], [1, 2, 5], [-1, 0], [-1, 0, 4], [4, 5, -5], [3, 0, 0, -4], [-4, 4, 5, 5], [-1, -3, 5, 4], [-1, 4, 4, 0], [-2, -5, 5, -1], [1], [-1, -3], [3, 5, 3, -4], [0, -4, 3], [4], [-1, -3, -4], [-1, 1, -1, 4], [-3], [3, 0], [2], [-2, -4], [-2, 5, 5], [4, 4, 5], [-1, 0], [4, 3], [3, 1], [-1, 4, -4], [1, 4, -1], [-2, 4, -3], [4, 5, 2], [1, 2, -1, -5], [-5, 3, -5], [1, -4], [-3], [-3, 2], [1, -3, 0, 4], [5, 1], [0, -4, 0, 5], [-2, 0], [3, -5, 3, -2], [4, 4, 2], [-3, 4], [3], [0, 5], [-2], [2, 1, -5], [-1, 3, -1], [-4, 1], [-4, -3, 4], [3, 3, -3, 2], [-4], [-3, -1, 2], 8],formula.POLYNOMIAL)
    # [[5, -3, 5], [3], [-2], [-3, 4, -2], [3, -4], [-3, -5, -4], [-5], [1, 3], [-4, 3, -2], [1, 4, 1, 4], [-1, 0, -4], [-4, -5, -5], [4, -4, 1], [2, 1, 4, 4], [1, -4, 2, -1], [2, 1, 2], [4], [-3], [-5, 2, -3], [-5, 0], [0, -4], [4, 2], [0, -1, 3, 0], [3, 1], [4, -1, -4, 5], [-2, 5, 1], [0, -5], [2, 2, -4, 1], [-4], [-4, -4, 4, 0], [-3, -1, 3], [-2, 3], [-4, 1], [4], [5], [-3], [-1], [0, -4], [4, 0, 5], [-4, -5, -5, 5], [-2, 5], [-2, 4], [-3, 4], [5, 3, -1, 5], [4], [5, 0], [0, -3, 2, -5], [0, 5, 2, 1], [0, 3], [0, 5, 2], [3, -1, 2], [-2, 4, -3, 5], [-3, 1, -2], [-1, 5, -1, -1], [-3, 4, -2], [-1, -3], [-3, -2], [-2, -2], [4, -4, -3, -3], [5, -3, -3], [4, 4, 5, -1], [2, 4, -4], [1], [2], [4, 3], [5, 1], [-2, -3, -2], [0, 0, 5], [3, 5, 0, 2], [-4, -1, 0], [-4, -5], [-4, 0, 5], [-2, -4, -5, 3], [2, -3, -3], [1, -5, -2], [3], [-2], [5, -4, 0, 3], [3], [1, -3, -2], [4], [-3, 0, 0], [3, -4], [2, -3], [0, 2, 2], [-5, 3], [0, 1], [4, -2, 2], [-5, 1], [4, 1], [2, 4], [5], [-3, -4, -5, 3], [3, -3, 2], [2], [2, 2, -4, 4], [1], [1, -1], [4], [1, 3], 3],formula.POLYNOMIAL)
    # [[3, -5], [1, -3, 2], [-1], [1, 0], [5, -4, 3, 4], [5, -3, 1], [3], [5, -1, 1, -2], [-2, 2, -1, -5], [2, -2], [0], [3, -3], [-3, -1], [-2, 3], [-1], [-2], [-5, 1, -3], [0, 3], [-5, 5], [-4, -5, 3, 5], [-4], [2, 0, -1, -3], [4, -2], [4, 2, 0, -2], [1], [-1, 4, -1, 2], [-2, -2], [2], [-3], [2, -4, 5], [-3], [-1, -1, -3, 0], [-4, -4], [-3], [5, 2, 4], [3, 5, 1, -3], [-3, -5], [5, -5, 0], [-5, 2, 4], [-3, -3], [1], [5], [2, -3, 0, -2], [-2], [4, -1, 5, -5], [2, 2, 1], [4, 4], [0, 3, -5], [-4, 0, -3, -3], [-1], [5, -1, -1, -2], [5, 2, -5, 4], [-5, -3, -5, 4], [5, -2, 3, 4], [-5], [1, -4, 3, 5], [3, -3, -3], [-5, 1, -3], [-2, -1, 4], [0, 3], [4], [-2, -2, -1, -5], [-1, -3, -4], [-2, -3, 4, 3], [0], [-1], [-1], [-3, 1], [0, -3, -3, -2], [3, -3, 0, -3], [5, -5], [-4, -5, 2], [-1], [-4, 0, 1, -5], [2, 2, -5], [1, 5, 0, 3], [0, 2], [-4, 0, 0, -2], [2], [1, -2], [-1, -2, -3, 5], [1], [3], [-3, -2, 4, -5], [-2], [2], [3, 1], [3, 0, 5, 3], [5, -3, -1], [4, 3, 5], [2, 2, 0], [-4, -5, -1, 5], [0, 4, -1], [-1], [4, -3, -4], [2, 1, -5, 5], [4, 2, 0, 4], [1], [1, 0, -2], [2, -2, 5, -4], -8],formula.POLYNOMIAL)
    # [[[0, 0]], [500]], formula.POLYHEDRON)
    # [[[-571, 31]], [445]], formula.POLYHEDRON)
    # [[[0, 0]], [500]], formula.POLYHEDRON)
    formula_list.put(formu.get_category(), formu)
    # formulas.put([[[12,0],[-12,0]],[4,4]])

    return formula_list