Permalink
Browse files

make dirichlet alpha a variable; get rid of spurious output

  • Loading branch information...
1 parent 7bf6674 commit 6bbcc666906ea0384530e4d9a1dff878f56e3113 @a1k0n committed Nov 25, 2011
Showing with 3 additions and 5 deletions.
  1. +3 −1 bot/Ant.h
  2. +0 −4 bot/State.cc
View
@@ -6,6 +6,8 @@
#include <vector>
#include <stdio.h>
+static const int kDirichletAlpha = 1;
+
// use conditional probabilities when sampling (seems to be weaker due to
// limited sampling)
#undef CONDITIONAL
@@ -51,7 +53,7 @@ struct Ant
move_ = 0; nEnemies_ = 0; dead_ = committed_ = false;
#ifdef CONDITIONAL
for(int j=0;j<5*5*5;j++)
- dirichlet_[j] = 1;
+ dirichlet_[j] = kDirichletAlpha;
for(int j=0;j<5*5;j++)
converged_[j] = -1;
#else
View
@@ -73,9 +73,7 @@ void State::computeCircleDelta(const Location &delta,
((x*x + y*y <= viewradius2) ? 1 : 0));
if(delta != 0)
adjust->push_back(make_pair(Location(y,x), delta));
- fputc((x==0)&&(y==0)?'O':delta == 0 ? '.' : delta == -1 ? '-' : '+', stderr);
}
- fputc('\n', stderr);
}
}
@@ -369,7 +367,6 @@ void State::setViewRadius(int radius2)
viewBoxSize = (int) sqrt(radius2);
for(int m=0;m<TDIRECTIONS;m++) {
visibilityAdjust[m].clear();
- fprintf(stderr, "direction %c: view adjust\n", CDIRECTIONS[m]);
computeCircleDelta(Location(DIRECTIONS[m][0], DIRECTIONS[m][1]),
&visibilityAdjust[m], viewBoxSize, viewradius2);
}
@@ -381,7 +378,6 @@ void State::setAttackRadius(int radius2)
attackBoxSize = (int) sqrt(radius2);
for(int m=0;m<TDIRECTIONS;m++) {
visibilityAdjust[m].clear();
- fprintf(stderr, "direction %c: attack adjust\n", CDIRECTIONS[m]);
computeCircleDelta(Location(DIRECTIONS[m][0], DIRECTIONS[m][1]),
&attackAdjust[m], attackBoxSize, attackradius2);
}

0 comments on commit 6bbcc66

Please sign in to comment.