Advertisement
dvulakh

construction_graph.h

Mar 4th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.16 KB | None | 0 0
  1.  
  2. #ifndef CONSTR_G
  3. #define CONSTR_G
  4.  
  5. #include "multithread.h"
  6. #include <functional>
  7. #include <string>
  8. #include <list>
  9.  
  10. using namespace std;
  11.  
  12. #define MAX_HETA 1000000
  13.  
  14. typedef int cost;
  15. typedef int vertex;
  16. typedef pair<list<vertex>*, cost> path;
  17. typedef double pheromone;
  18.  
  19. class construction_graph
  20. {
  21. protected:
  22.     class wrapped_iterator
  23.     {
  24.     public:
  25.         virtual bool eq(wrapped_iterator*);
  26.         virtual pheromone& val();
  27.         virtual void nxt();
  28.     };
  29. public:
  30.     class iterator
  31.     {
  32.     private:
  33.         wrapped_iterator* wit;
  34.     public:
  35.         bool operator==(const iterator& it);
  36.         bool operator!=(const iterator& it);
  37.         iterator(wrapped_iterator*);
  38.         iterator& operator++(int);
  39.         pheromone& operator*();
  40.         virtual ~iterator();
  41.     };
  42.     virtual void place_path(path&, vertex&, pheromone);
  43.     virtual void delta_path(path&, vertex&, pheromone);
  44.     virtual pair<pheromone, int> tau(path&, vertex&);
  45.     virtual pheromone heta(path&, vertex&);
  46.     virtual cost cost_of(path&, vertex&);
  47.     virtual pheromone* direct_tau(int);
  48.     virtual iterator begin();
  49.     virtual path cand(path&);
  50.     virtual string log_str();
  51.     virtual iterator end();
  52.     virtual void init();
  53.     int max_val;
  54.     int nvar;
  55. };
  56.  
  57. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement