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

Private GIT Repository
Add torus topology.
[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(btree);
35 DEPLOYMENT(clique);
36 DEPLOYMENT(hcube);
37 DEPLOYMENT(line);
38 DEPLOYMENT(ring);
39 DEPLOYMENT(star);
40 DEPLOYMENT(torus);
41
42 #undef DEPLOYMENT
43
44 #endif // !DEPLOYMENT_H
45
46 // Local variables:
47 // mode: c++
48 // End: