]> AND Private Git Repository - loba.git/blob - deployment.h
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Add automatic topology generators.
[loba.git] / deployment.h
1 #ifndef DEPLOYMENT_H
2 #define DEPLOYMENT_H
3
4 #include <vector>
5
6 void MY_launch_application();
7
8 class deployment_generator {
9 public:
10     deployment_generator();
11
12     size_t size() const { return hosts.size(); }
13     void set_load(int host, double load);
14     void set_neighbor(int host, int neighbor);
15     void set_link(int host1, int host2);
16
17     virtual void generate() = 0;
18     void deploy();
19
20 private:
21     struct host_parameters {
22         double load;
23         std::vector<int> neighbors;
24     };
25
26     std::vector<host_parameters> hosts;
27 };
28
29 #define DEPLOYMENT(name)                                        \
30     class deployment_ ## name: public deployment_generator {    \
31     public: void generate();                                    \
32     }
33
34 DEPLOYMENT(line);
35 DEPLOYMENT(ring);
36 DEPLOYMENT(star);
37 DEPLOYMENT(clique);
38 DEPLOYMENT(btree);
39 // DEPLOYMENT(torus);
40 DEPLOYMENT(hcube);
41
42 #undef DEPLOYMENT
43
44 #endif // !DEPLOYMENT_H
45
46 // Local variables:
47 // mode: c++
48 // End: