Beispiel #1
0
 def load_map(self):
     self.map_blocks = level_map.get_level_map(self.level)
     for element in self.map_blocks:
         color, xpos, ypos = element
         image = self.block_dict[color]
         obj_ = blocks.Block(self.surface, image, (xpos, ypos), color)
         self.on_screen_blocks.append(obj_)
def print_steps():
    probabilities = parse_submission(SUBMIT_FILE)
    print len(probabilities), probabilities
    print "--"
    levmap = level_map.get_level_map(MAPPING_FILENAMES)
    print len(levmap), levmap
    print "--"
    inverted_levmap = invert_map(levmap)
    print len(inverted_levmap), inverted_levmap
    print "--"
    derived_probs = derive_label_probabilities(probabilities, inverted_levmap)
    print len(derived_probs), derived_probs
def print_steps_ind():
    probabilities = parse_submission_ind(SUBMIT_FILE)
    # print len(probabilities),probabilities
    print "--"
    levmap = level_map.get_level_map(MAPPING_FILENAMES)
    print len(levmap), levmap
    print "--"
    inverted_levmap = invert_map(levmap)
    print len(inverted_levmap), inverted_levmap
    print "--"
    derived_probs = derive_label_probabilities_ind(probabilities,
                                                   inverted_levmap)
    print len(derived_probs)
    count = 0
    for derived_prob_ind in derived_probs:
        print len(derived_prob_ind
                  ), derived_prob_ind, derived_probs[derived_prob_ind]
        count += 1
        if count > 5:
            break
def get_derived_probabilities_ind(prob_file, mapping_files):
    probabilities = parse_submission_ind(prob_file)
    levmap = level_map.get_level_map(mapping_files)
    inverted_levmap = invert_map(levmap)
    return derive_label_probabilities_ind(probabilities, inverted_levmap)