From fed6d6e31d819ecae21e9c3b9315b5877deb3f42 Mon Sep 17 00:00:00 2001
From: Joseph Redmon <pjreddie@gmail.com>
Date: Tue, 22 Sep 2015 01:18:51 +0000
Subject: [PATCH] idk man

---
 src/compare.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/compare.c b/src/compare.c
index 0408f80..74c1cf5 100644
--- a/src/compare.c
+++ b/src/compare.c
@@ -241,7 +241,8 @@
     srand(time(0));
     set_batch_network(&net, 1);
 
-    list *plist = get_paths("data/compare.sort.list");
+    //list *plist = get_paths("data/compare.sort.list");
+    list *plist = get_paths("data/compare.cat.list");
     //list *plist = get_paths("data/compare.val.old");
     char **paths = (char **)list_to_array(plist);
     int N = plist->size;
@@ -256,15 +257,16 @@
     }
     int round;
     clock_t time=clock();
-    for(round = 1; round <= 40; ++round){
+    for(round = 1; round <= 500; ++round){
         clock_t round_time=clock();
         printf("Round: %d\n", round);
         qsort(boxes, N, sizeof(sortable_bbox), elo_comparator);
         sorta_shuffle(boxes, N, sizeof(sortable_bbox), 10);
+        shuffle(boxes, N, sizeof(sortable_bbox));
         for(i = 0; i < N/2; ++i){
             bbox_fight(boxes+i*2, boxes+i*2+1);
         }
-        if(round >= 4){
+        if(round >= 4 && 0){
             qsort(boxes, N, sizeof(sortable_bbox), elo_comparator);
             if(round == 4){
                 N = N/2;
@@ -275,9 +277,11 @@
         printf("Round: %f secs, %d remaining\n", sec(clock()-round_time), N);
     }
     qsort(boxes, N, sizeof(sortable_bbox), elo_comparator);
+    FILE *outfp = fopen("results/battle.log", "w");
     for(i = 0; i < N; ++i){
-        printf("%s %f\n", boxes[i].filename, boxes[i].elo);
+        fprintf(outfp, "%s %f\n", boxes[i].filename, boxes[i].elo);
     }
+    fclose(outfp);
     printf("Tournament in %d compares, %f secs\n", total_compares, sec(clock()-time));
 }
 

--
Gitblit v1.10.0