Example #1
0
def generate_universes(gs, sample):
    x1 = FuzzyUniverse("Attr1", 0, 100, sample)
    x1["A1"] = MembershipFunc(0, gs[0].value(), gs[1].value())
    x1["A2"] = MembershipFunc(gs[2].value(), gs[3].value(), gs[4].value())
    x1["A3"] = MembershipFunc(gs[5].value(), gs[6].value(), 100)

    x2 = FuzzyUniverse("Attr2", 0, 100, sample)
    x2["B1"] = MembershipFunc(0, gs[7].value(), gs[8].value())
    x2["B2"] = MembershipFunc(gs[9].value(), gs[10].value(), gs[11].value())
    x2["B3"] = MembershipFunc(gs[12].value(), gs[13].value(), 100)

    return x1, x2
Example #2
0
def func_y(sample):
    f = FuzzyUniverse("TempoLavagem", 0, 60, sample)
    f["MC"] = MembershipFunc(0, 0, 10)
    f["C"] = MembershipFunc(0, 10, 25)
    f["M"] = MembershipFunc(10, 25, 40)
    f["L"] = MembershipFunc(25, 40, 60)
    f["ML"] = MembershipFunc(40, 60, 60)
    return f
Example #3
0
def func3():
    """

    :return: FuzzyUniverse
    """

    func = FuzzyUniverse("forca", 0.0, 100.0, SAMPLE)
    func['media'] = MembershipFunc(0.0, 0.0, 50.0)
    func['forte'] = MembershipFunc(0.0, 50.0, 100.0, 100.0)
    return func
Example #4
0
def func2():
    """

    :return: FuzzyUniverse
    """

    func = FuzzyUniverse("peso", 0.0, 100.0, SAMPLE)
    func['leve'] = MembershipFunc(0.0, 0.0, 50.0)
    func['moderado'] = MembershipFunc(0.0, 50.0, 100.0)
    func['pesado'] = MembershipFunc(50.0, 100.0, 100.0)
    return func
Example #5
0
def func1():
    """

    :return: FuzzyUniverse
    """

    func = FuzzyUniverse("altura", 1.0, 2.0, SAMPLE)
    func['baixo'] = MembershipFunc(1.0, 1.0, 1.5)
    func['medio'] = MembershipFunc(1.0, 1.5, 2.0)
    func['alto'] = MembershipFunc(1.5, 2.0, 2.0)
    return func
Example #6
0
def func_x2(sample):
    f = FuzzyUniverse("Mancha", 0, 100, sample)
    f["SM"] = MembershipFunc(0, 0, 50)
    f["MM"] = MembershipFunc(0, 50, 100)
    f["GM"] = MembershipFunc(50, 100, 100)
    return f
Example #7
0
def func_x1(sample):
    f = FuzzyUniverse("Sujeira", 0, 100, sample)
    f["PS"] = MembershipFunc(0, 0, 50)
    f["MS"] = MembershipFunc(0, 50, 100)
    f["GS"] = MembershipFunc(50, 100, 100)
    return f
Example #8
0
def func2(sample):
    x2 = FuzzyUniverse("Attr2", 0, 100, sample)
    x2["B1"] = MembershipFunc(0, 0, 40)
    x2["B2"] = MembershipFunc(20, 50, 80)
    x2["B3"] = MembershipFunc(60, 100, 100)
    return x2
Example #9
0
def func1(sample):
    x1 = FuzzyUniverse("Attr1", 0, 100, sample)
    x1["A1"] = MembershipFunc(0, 0, 40)
    x1["A2"] = MembershipFunc(20, 50, 80)
    x1["A3"] = MembershipFunc(60, 100, 100)
    return x1