Commits

David Jones committed 429d16b

more comments.

Comments (0)

Files changed (1)

                                                      self.pw.planets[idx].growth_rate, 2)
                          for idx in self.pidx]
 
+  def score_end_count(self):
+    """
+    Calculate the score based on the counts at the end of the
+    future calculations.
 
+    In addition to counting up the differences between ship
+    counts, add in a multiple of the difference of growth
+    rates.  That multiplier is based on the closest distance
+    between me and the enemy.  I had some reasons in picking
+    these numbers, but they are pretty much magic numbers.
 
-  def score_growth(self):
-    values = [(self.futures[i][-1][1], self.pw.planets[i].growth_rate)
-              for i in self.pidx]
-    values = [(x,y) for (x,y) in values if x > 0]
-    
-    debug("score: values %s", values)
-
-    counts = [0,0,0]
-    for (x,y) in values:
-      counts[x] += y
-    
-    return [counts[1] - counts[2], -counts[2]]
-
-  def score_end_count(self):
+    The score is set up so that my bot prefers to have a
+    small number of ships when winning (to prefer trading when
+    ahead), and to avoid trading when losing.
+    """
     counts, rates = self.get_end_rates()
     if self.closest_distance < 1:
       rate_mult = 0
       return [score, counts[2]]
 
   def score(self):
+    """This is leftover from trying different scoring schemes"""
     return self.score_end_count()
     # return self.score_exponential()