Skip to content
Browse files

convergence check is good++; also limit turn time to 475ms

  • Loading branch information...
1 parent 67e319d commit efb2efc216041f37671bfae31841baa0d2adcce2 @a1k0n committed
Showing with 3 additions and 2 deletions.
  1. +2 −1 bot/Ant.cc
  2. +1 −1 bot/Bot.cc
View
3 bot/Ant.cc
@@ -7,6 +7,7 @@
#include <float.h>
//#define BLAH
+#define CONVERGENCE_CHECK
bool Ant::TerritoryMove(State &s, int move)
{
@@ -202,7 +203,7 @@ int Ant::SampleMove(State &s)
}
// if over 93% of the probability mass is in this direction, we can probably
// stop sampling here.
-#ifdef CONVERGENCE
+#ifdef CONVERGENCE_CHECK
if(dirichlet_[dir_base+dir] > 15*fullsum/16) {
// 15/16 = ~93%
converged_[dir_base/5] = dir;
View
2 bot/Bot.cc
@@ -102,7 +102,7 @@ void Bot::makeMoves()
int Nmy = state.myAnts.size();
int Nenemy = state.enemyAnts.size();
int Nants = Nmy + Nenemy;
- int maxTurnTime = 95*state.turntime/100;
+ int maxTurnTime = std::min(475.0, 95*state.turntime/100);
for(int smp=0;smp<5000;smp++) {
for(int j=0;j<Nants;j++) {
int i = lrand48()%Nants;

0 comments on commit efb2efc

Please sign in to comment.
Something went wrong with that request. Please try again.