Index: /nodes/channelga.py
===================================================================
--- /nodes/channelga.py	(revision 1928)
+++ /nodes/channelga.py	(revision 1929)
@@ -20,4 +20,5 @@
 import re
 import random
+import os
 
 # deze twee zijn nodig voor de evaluatie van een configuratie
@@ -236,5 +237,5 @@
 					# nee. maak een groep en voeg beide
 					# endpoints toe
-					group = WIGroup('foo')
+					group = WIGroup("group%d" % len(groups))
 					group.add_wi(wi)
 					groups.append(group)
@@ -245,4 +246,15 @@
 # END UGLY PARSING CODE
 
+def plot_configuration(conf, out):
+	out.write("digraph plot {\n")
+	for i in range(len(groups)):
+		out.write("group%s [label=\"%d\"]\n" % (i, conf[i]))
+	for nodename in nodes.keys():
+		for wi in nodes[nodename].wis:
+			if wi.group == None:
+				continue
+			out.write("%s -> %s\n" % (nodename, wi.group.name))
+	out.write("}")
+
 parse_metafile('l')
 
@@ -252,10 +264,13 @@
 	population.append(conf)
 
-while 1:
-	for i in range(10):
+for iteration in range(1000):
+	for i in range(0, 9):
 		p = population[i].copy()
-		population[i].crossover(population[i + 10], 8)
+		population[i].crossover(population[i + 10], random.randint(1, 4) * 2)
 		population[i + 10] = p
-		population[i + 10].mutate(0.01)
+		population[i + 10].mutate(0.05)
 	population.sort(lambda a, b: cmp(b.score(), a.score()))
-	print population[0].score(), population[0].conf
+print population[0].score()
+plot_configuration(population[0].conf, open("foo.dot", 'w'))
+os.system('neato -Gstart=foo -Goverlap=false/scale -Gsplines=true -Gsep=2 -Gratio=fill -Gnslimit=50.0 -Grotate=90 -Gsize="11,7.5" -Tps -o channelga.ps foo.dot')
+
