X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/9c6f9565824d2cc3389e87f13ee9a0308d615807..ef1ef576d25c492dc585240b8a4b36954fc00140:/deployment.h?ds=inline diff --git a/deployment.h b/deployment.h index 4dde480..3e71df5 100644 --- a/deployment.h +++ b/deployment.h @@ -1,8 +1,48 @@ #ifndef DEPLOYMENT_H #define DEPLOYMENT_H +#include + +// Deploy an application automatically, according to the global parameters void MY_launch_application(); +// Base class for deployment generators... +class deployment_generator { +public: + deployment_generator(); + + size_t size() const { return hosts.size(); } + void set_load(int host, double load); + void set_neighbor(int host, int neighbor); + void set_link(int host1, int host2); + + virtual void generate() = 0; + void deploy(); + +private: + struct host_parameters { + double load; + std::vector neighbors; + }; + + std::vector hosts; +}; + +#define DEPLOYMENT(name) \ + class deployment_ ## name: public deployment_generator { \ + public: void generate(); \ + } + +DEPLOYMENT(btree); +DEPLOYMENT(clique); +DEPLOYMENT(hcube); +DEPLOYMENT(line); +DEPLOYMENT(ring); +DEPLOYMENT(star); +DEPLOYMENT(torus); + +#undef DEPLOYMENT + #endif // !DEPLOYMENT_H // Local variables: