Permalink
Browse files

better performance

  • Loading branch information...
Error323 committed Nov 2, 2010
1 parent ec91a12 commit 39712d674abcb252cb0a161633b6151192d34d29
Showing with 4 additions and 7 deletions.
  1. +2 −2 Makefile
  2. +2 −5 MyBot.cc
View
@@ -1,6 +1,6 @@
DEBUG=-g -rdynamic -DDEBUG
-CC=g++ -O2 -march=core2 #$(DEBUG)
-CFLAGS=-Wall -Wextra #$(DEBUG)
+CC=g++ -O2 -march=core2 $(DEBUG)
+CFLAGS=-Wall -Wextra $(DEBUG)
OBJECTS=MyBot.o Timer.o Logger.o vec3.o PlanetWars.o Simulator.o Map.o KnapSack.o
VERSION=`git describe --tags`
View
@@ -20,7 +20,7 @@
#endif
-#define VERSION "15.2"
+#define VERSION "15.3"
#define EPS 1.0e-10
@@ -43,10 +43,7 @@ struct NPV {
};
double GetValue(Planet& p, int dist) {
- //double nom = std::numeric_limits<double>::max();
- //double denom = (p.NumShips() / (p.GrowthRate() + EPS) + log(pow(2.0, dist)));
- //return nom / denom;
- return (pow(p.GrowthRate(), 2.0) / p.NumShips()) / dist;
+ return pow(p.GrowthRate(), 2.0) / (p.NumShips() * dist + EPS);
}
int GetIncommingFleets(const int sid, std::vector<Fleet>& AF, std::vector<int>& FIDX) {

0 comments on commit 39712d6

Please sign in to comment.