print 'Missing input file(s).\n' optparser.print_usage() exit(1) if not (options.labels_file or options.places_file or options.registrations_file): print 'Missing output file(s): labels, place points, or registration points.\n' optparser.print_usage() exit(1) # # Load places. # places = Places(bool(options.dump_file)) for place in load_places(input_files, geometry, options.name_field): places.add(place) def state_energy(places): return places.energy def state_move(places): places.move() try: annealer = Annealer(state_energy, state_move) if options.temp_min and options.temp_max and options.steps: places, e = annealer.anneal(places, options.temp_max, options.temp_min, options.steps, 30) else: places, e = annealer.auto(places, options.minutes, 500)
optparser.print_usage() exit(1) if not (options.labels_file or options.places_file or options.registrations_file): print 'Missing output file(s): labels, place points, or registration points.\n' optparser.print_usage() exit(1) # # Load places. # places = Places(bool(options.dump_file)) for place in load_places(input_files, geometry, options.name_field): places.add(place) def state_energy(places): return places.energy def state_move(places): places.move() try: annealer = Annealer(state_energy, state_move) if options.temp_min and options.temp_max and options.steps: places, e = annealer.anneal(places, options.temp_max, options.temp_min, options.steps, 30) else:
options, input_files = optparser.parse_args() if not input_files: print 'Missing input file(s).\n' optparser.print_usage() exit(1) elif not (options.labels_file or options.places_file or options.registrations_file): print 'Missing output file(s): labels, place points, or registration points.\n' optparser.print_usage() exit(1) places = Places(bool(options.dump_file)) for place in load_places(input_files, options.zoom): places.add(place) def state_energy(places): return places.energy def state_move(places): places.move() try: annealer = Annealer(state_energy, state_move) if options.temp_min and options.temp_max and options.steps: places, e = annealer.anneal(places, options.temp_max, options.temp_min, options.steps, 30) else:
if __name__ == '__main__': options, input_files = optparser.parse_args() if not input_files: print 'Missing input file(s).\n' optparser.print_usage() exit(1) elif not (options.labels_file or options.places_file or options.registrations_file): print 'Missing output file(s): labels, place points, or registration points.\n' optparser.print_usage() exit(1) places = Places(bool(options.dump_file)) for place in load_places(input_files, options.zoom): places.add(place) def state_energy(places): return places.energy def state_move(places): places.move() try: annealer = Annealer(state_energy, state_move) if options.temp_min and options.temp_max and options.steps: places, e = annealer.anneal(places, options.temp_max, options.temp_min, options.steps, 30) else: places, e = annealer.auto(places, options.minutes, 500)