Beispiel #1
0
    groups_lo = [
        group.Group("a", 320 * 3, .1),
        group.Group("a", 640 * 3, .1, 1),
        group.Group("b", 320 * 3, .2)
    ]

    groups_hi = [
        group.Group("a", 640 * 3, .1),
        group.Group("a", 320 * 3, .1, 1),
        group.Group("b", 320 * 3, .2)
    ]

    groups_all = [group.Group("a", 960 * 3, .1), group.Group("b", 320 * 3, .2)]

    city_no = city.City(groups_no, 16)
    city_no.generate_uniform()

    city_no_seg = city.City(groups_no, 16)
    city_no_seg.generate_uniform_seg()

    city_lo = city.City(groups_lo, 16)
    city_lo.generate_mixed([[("a", 0)], [("a", 1), "b"]])

    city_lo_seg = city.City(groups_lo, 16)
    city_lo_seg.generate_mixed_seg([[("a", 0)], [("a", 1), "b"]])

    city_hi = city.City(groups_hi, 16)
    city_hi.generate_mixed([[("a", 0)], [("a", 1), "b"]])

    city_hi_seg = city.City(groups_hi, 16)
Beispiel #2
0
from massey import analyzer
from massey import group
from massey import city
from massey import visualizer

if __name__ == "__main__":
    groups0 = [group.Group("humans", 20, .5), group.Group("elves", 20, 0)]

    groups1 = [
        group.Group("humans", 1800, .3),
        group.Group("elves", 600, 0),
        group.Group("orcs", 1200, .5)
    ]

    city0 = city.City(groups0, 5)

    city0.generate_segregated_seg()
    print(analyzer.entropy_index(city0, True))
    # print(analyzer.entropy_score_city(city0, True))

    # print(city0.generate_segregated())

    city1 = city.City(groups1, 120)

    # print(city1.generate_uniform())
    # print(city1.generate_segregated())
    # print("")
    # print(city1.generate_mixed([["humans"], ["elves", "orcs"]]))
    # print(city1.generate_mixed_seg([["humans"], ["elves", "orcs"]]))

    city1.generate_mixed_seg([["humans"], ["elves", "orcs"]])