summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtsp.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tsp.py b/tsp.py
index 5ccef41..5b7d7fc 100755
--- a/tsp.py
+++ b/tsp.py
@@ -42,13 +42,14 @@ OFFSET_Y = 20
CITY_RADIUS = 3
-DEFAULT_COUNT = 100
-
SHOW_NAMES = True
ALGOS = ["2opt"]
COUNTS = [8, 10, 25, 50, 100, 250]
+DEFAULT_ALGO = "2opt"
+DEFAULT_COUNT = 50
+
class Color:
def __init__ (self, r, g, b):
@@ -327,11 +328,11 @@ class AlgoGui (gtk.Window):
hbox = gtk.HBox ()
self.algo_box = gtk.combo_box_new_text ()
map (self.algo_box.append_text, ALGOS)
- self.algo_box.set_active (ALGOS.index ("2opt"))
+ self.algo_box.set_active (ALGOS.index (DEFAULT_ALGO))
hbox.pack_start (self.algo_box, False, False)
self.count_box = gtk.combo_box_new_text ()
map (lambda i: self.count_box.append_text ("%d cities" % i), COUNTS)
- self.count_box.set_active (COUNTS.index (25))
+ self.count_box.set_active (COUNTS.index (DEFAULT_COUNT))
hbox.pack_start (self.count_box, False, False)
self.gen_button = gtk.Button ("Generate")
self.gen_button.connect ("clicked", self.generate)