[Lemon-commits] [lemon_svn] ladanyi: r1341 - hugo/trunk/src/work/akos

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:44:43 CET 2006


Author: ladanyi
Date: Thu Nov  4 19:52:31 2004
New Revision: 1341

Modified:
   hugo/trunk/src/work/akos/simann_test.cc

Log:
Updated because of the recent changes in simann.h.

Modified: hugo/trunk/src/work/akos/simann_test.cc
==============================================================================
--- hugo/trunk/src/work/akos/simann_test.cc	(original)
+++ hugo/trunk/src/work/akos/simann_test.cc	Thu Nov  4 19:52:31 2004
@@ -1,48 +1,18 @@
-#include "simann.h"
 #include <cstdlib>
 #include <cmath>
-#include <iostream>
+#include "simann.h"
 
 using namespace lemon;
 
-class MyController : public SimAnnBase::Controller {
-public:
-  long iter, last_impr, max_iter, max_no_impr;
-  double temp, annealing_factor;
-  MyController() {
-    iter = last_impr = 0;
-    max_iter = 500000;
-    max_no_impr = 20000;
-    annealing_factor = 0.9999;
-    temp = 1000;
-  }
-  void acceptEvent() {
-    iter++;
-  }
-  void improveEvent() {
-    last_impr = iter;
-  }
-  void rejectEvent() {
-    iter++;
-  }
-  bool next() {
-    temp *= annealing_factor;
-    bool quit = (iter > max_iter) || (iter - last_impr > max_no_impr);
-    return !quit;
-  }
-  bool accept(double cost_diff) {
-    return (drand48() <= exp(cost_diff / temp));
-  }
-};
-
 class MyEntity {
 public:
   double mutate() { return 10.0; }
+  void revert() {}
 };
 
 int main() {
   SimAnn<MyEntity> simann;
-  MyController ctrl;
+  SimpleController ctrl;
   simann.setController(ctrl);
   MyEntity ent;
   simann.setEntity(ent);



More information about the Lemon-commits mailing list