コード例 #1
0
 /* Strategy 3: Strategy 2 with multi-planet dispatch.
  * - STAGE 1: Dispatch from our strongest planets, in order, accounting for own actions to avoid treading on own toes.
  * - If there were any of our planets left that haven't attacked, it's because they weren't strong enough.
  * - STAGE 2: Take their most desirable planets, in order, and dispatch from as many of our remaining planets as needed to take them.
  *
  * STRAT 3: ** need a way of accounting for this turn's orders, both in terms of our planets' available ships, and their planets' futures
  * Stage 2:
  * - take their strongest or strongest n (desc) and throw as much at them as needed from multiple planets (need to account for different fleet travel times).
  */
 /* STAGE 1 ONLY
  * DistanceOnlyWeight: Dual ?, Rage ?
  * Poly:
  *   0, 0, 2: 98 / 71
  *   0, 1, 0: 99 / 80
  *   0, 2, 0: 99 / 80
  *   0, 5, 0: 99 / 80
  *   0, 50, 0: 99 / 80
  *   0, 500, 0: 99 / 80
  *   2, 0, 0: 99 / 73
  *
  * STAGE 1 & 2
  * Poly 0, 2, 0: 99 / 78 (?? presumably fewer planets able to defend themselves against rage - same happens in strat 4)
  */
 static private double PolynomialDistanceWeight(Planet p, Planet reference, Polynomial poly)
 {
     return
         (((double)p.GrowthRate /
           ((double)p.ShipCount * /* Addition vs multiplication seems to make very little difference here */
            (poly * p.DistanceTo(reference))
           )
           ) *
          ((p.Owner == Players.Singleton.You) ? 2 : 1));
 }
コード例 #2
0
 private static double PolynomialDistanceWeight(Planet p, Planet reference, Polynomial poly)
 {
     return
         ( (double)p.GrowthRate /
           ( (double)p.ShipCount * /* Addition vs multiplication seems to make very little difference here */
             (poly * p.DistanceTo(reference))
           )
         ) *
         ( (p.Owner == Players.Singleton.You) ? 2 : 1 );
 }
コード例 #3
0
 private static double DistanceOnlyWeight(Planet p, Planet reference)
 {
     return 1 / (double)p.DistanceTo(reference);
 }
コード例 #4
0
 static private double DistanceOnlyWeight(Planet p, Planet reference)
 {
     return(1 / (double)p.DistanceTo(reference));
 }