src/work/akos/simann_demo.cc
author deba
Wed, 15 Dec 2004 19:56:55 +0000
changeset 1037 3eaff8d04171
parent 999 5c846ec3f787
child 1096 1cfb25ef14d2
permissions -rw-r--r--
graph_io under construction
This is a working version, but needs more improvments.

todo:
documention + fix the file format
improve the exception system

add some possible asserts

tutorials
     1 #include "simann.h"
     2 
     3 using namespace lemon;
     4 
     5 class MyEntity {
     6 public:
     7   double getCost() { return 10.0; }
     8   void mutate() {}
     9   void revert() {}
    10 };
    11 
    12 int main() {
    13   SimAnn<MyEntity> simann;
    14   SimpleController ctrl;
    15   simann.setController(ctrl);
    16   MyEntity ent;
    17   simann.setEntity(ent);
    18   simann.run();
    19 
    20   SimAnn<MyEntity> simann2;
    21   AdvancedController ctrl2(20.0);
    22   simann2.setController(ctrl2);
    23   MyEntity ent2;
    24   simann2.setEntity(ent2);
    25   simann2.run();
    26 }