Пример #1
0
def test_mixed_autoencoder():
    mm = stparser.MapManager()
    fba = FindBestAutoencoder(mm)
    print("Building model")
    model = fba.build_and_train_mixed_model(7, 140, 70, 200)
    print("mixed model results: ", fba.test_mixed_model(model, 7))    
    print("mixed model environment only results: ", fba.test_mixed_model_environment(model, 7))    
Пример #2
0
def test_autoencoding_paths():
    mm = stparser.MapManager()
    fba = FindBestAutoencoder(mm)
    #fba.perform_batch_test(7,200)
    print("Building model")
    model = fba.build_and_train_path_model(7, 140, 70, 200)
    print(fba.test_path_model(model, 7))    
Пример #3
0
def build_save_and_test_frequency_table(filename):
    mm = stparser.MapManager()
    gnm = GenerateNoisyMap(mm)
    print("Please wait...generating frequency table from levels")
    gnm.calculate_frequency_from_levels(LEVEL_LIST)
    print("Saving frequency table to csv file")
    gnm.save_frequency_table("solid_tile_frequency.csv")
    print("validating csv file")
    gnm2 = GenerateNoisyMap(mm)
    gnm2.load_frequency_table("solid_tile_frequency.csv")
Пример #4
0
        test_level.write_slice(lslice.reshape((7, 36)), 7 * c)
    test_map.add_tilemap(test_level)
    map_slice = test_map.get_slice(0, 200)
    stparser.show_image_in_window(
        stparser.generate_image_from_slice(map_slice))


def show_map(map):
    shape = map.get_map_size()
    map_slice = map.get_slice(0, shape[0])
    stparser.show_image_in_window(
        stparser.generate_image_from_slice(map_slice))


if __name__ == '__main__':
    mm = stparser.MapManager()
    gnm = GenerateNoisyMap(mm)
    gnm.load_frequency_table("solid_tile_frequency.csv")

    # build_and_show_noise_level(mm, gnm)
    gen = LevelGenerator(mm)
    # gen.create_model()
    #gen.model.save("st_generator.h5")
    model = STModel.STModel()
    model.create_model(36 * 7, 36 * 5, 36 * 3 + 18)
    model.load("st_generator.h5")
    gen.set_model(model)
    # map = gen.generate_block_level(500)
    successes = 0
    for test in range(100):
        map = gen.generate_slide_level(500, 0)
Пример #5
0
 def setUpClass(cls):
     cls.mm = stparser.MapManager()
     cls.test_level_filename = "levels/test/burnnmelt.stl"
     cls.level = cls.mm.get_map(cls.test_level_filename)
     cls.solid_map = cls.level.get_combined_solid()
Пример #6
0
def test_path_to_env_autoencoder():
    mm = stparser.MapManager()
    fba = FindBestAutoencoder(mm)
    print("Building model")
    model = fba.build_and_train_path_to_env_model(7, 140, 70, 400)
    print(fba.test_path_to_env_model(model, 7))