Seonghoon Kang avatar Seonghoon Kang committed 1f656c1

snapshot

Comments (0)

Files changed (7)

 split
 verifier
 *.pyc
-temp?.rle
+*.rle
 You can also use `./solve.sh N` and `./verify.sh N` for individually solving
 and verifying single test case. See `solve.sh` for strategies used.
 
-The entire process took less than 20 minutes in MacBook Air (Mid 2011) with
+The entire process took about 13 minutes in MacBook Air (Mid 2011) with
 4 GiB RAM. This does not include the time spent for tweaking various
 parameters and algorithms. YMMV.
 
                     for currule in currules:
                         elimrules0[currule, '\n'.join(curpat)] = \
                                 dict((k, '\n'.join(v)) for k,v in curelims.items())
+                    currules = [line]
             else:
                 currules = [line]
             curpat = []
 				fprintf(fp, "%d", it->first - lastx);
 			}
 			fputc('$', fp);
+			// Golly is prone to very, very long (1000000+ chars) line,
+			// so we have to add newlines appropriately.
+			fputc('\n', fp);
 			lastx = it->first;
 			lasty = 0;
 		}
 stabilizes around generation 60000, final population around 6600000
 minimal known cost 201376950 at generation 41561 with population 6629443
 
-./generate.sh 70000 data/input3.rle analysis/input3-gen70000.rle analysis/population3.csv
-./leastcost.sh 30 60 < analysis/population3.csv
+./dayandnight analysis/input3-dayandnight.rle < data/input3.txt > /dev/null
+./generate.sh 80000 analysis/input3-dayandnight.rle analysis/input3-dayandnight-gen80000.rle analysis/population3-dayandnight.csv
+./leastcost.sh 30 60 < analysis/population3-dayandnight.csv
 
 #4
 1000000 1000000 3252960 1 2 B35678/S5678
 #7
 1000000 1000000 3214873 2 4 B368/S245
 stabilizes around generation 200, final population around 44000
-minimal known cost 87186 at generation 282 with population 43029
+minimal known cost 86170 at generation 281 with population 42523
 
 ./generate.sh 500 data/input7.rle analysis/input7-gen500.rle analysis/population7.csv
 ./leastcost.sh 2 4 < analysis/population7.csv
 
+Error: population 0 expected, 53505 actual (table size 53505)
+okay, patched. cost=155834
+
 #8
 1000000 1000000 4999980 5 700 B3/S23
 lots of gliders...
 ----
 
 v = map(int,'''
-4 216 2246815 8379090 3210515 826244 631108 41814 5006030
+4 216 2245906 8457030 3210515 814610 630658 155834 5003295
 ''' '''
 4 204 2245528 12149490 701427 858694 966868 27486 5001495 
 4 316 2245528 12149490 701427 969414 1024548 86980 5001495
 shouldrun 1 && elimcomps 1
 shouldrun 2 && elimcomps 2
 #shouldrun 3 && cherrypick 3 41561 6629443
-shouldrun 3 && cherrypick_dayandnight 3 67114 144335
+shouldrun 3 && cherrypick_dayandnight 3 67114 146947
 shouldrun 4 && bruteforce 4 3252960
-shouldrun 5 && cherrypick 5 5386 477501
+shouldrun 5 && cherrypick 5 5414 470856
 #shouldrun 6 && bruteforce 6 3025056
 shouldrun 6 && elimcomps 6 5120 2 4
 #shouldrun 7 && cherrypick 7 282 43029
 	unlink("temp2.rle");
 }
 
+void evolven(int k) {
+	evolve_with_golly(k);
+}
+
 int main(int argc, char **argv) {
 	if (argc < 3) {
 		fprintf(stderr, "Usage: %s data/outputX.txt data/outputX-prev.txt < data/inputX.txt\n", argv[0]);
 			cost += cn;
 		} else if (strcmp(buf, "SET") == 0) {
 			if (nnexts) {
-				evolve_with_golly(nnexts);
+				evolven(nnexts);
 				nnexts = 0;
 			}
 			int x, y;
 		}
 	}
 	if (nnexts) {
-		evolve_with_golly(nnexts);
+		evolven(nnexts);
 	}
 
 	if (p > 0 || !table.empty()) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.