X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5faf49cdf3f8ad8751317b857a6d3134fe07eda3..d0ffc37686edcc803601f76ab51fdfed5fc2f241:/src/surf/network.hpp diff --git a/src/surf/network.hpp b/src/surf/network.hpp index 32fbdaa45e..f51a46e35f 100644 --- a/src/surf/network.hpp +++ b/src/surf/network.hpp @@ -29,13 +29,14 @@ typedef NetworkCm02ActionLmm *NetworkCm02ActionLmmPtr; *********/ extern NetworkCm02ModelPtr surf_network_model; - +void net_define_callbacks(void); /********* * Model * *********/ class NetworkCm02Model : public Model { public: + NetworkCm02Model(int i) : Model("network") {};//FIXME: add network clean interface NetworkCm02Model(string name); NetworkCm02Model(); //FIXME:NetworkCm02LinkPtr createResource(string name); @@ -49,16 +50,15 @@ public: e_surf_link_sharing_policy_t policy, xbt_dict_t properties); void updateActionsStateLazy(double now, double delta); - void updateActionsStateFull(double now, double delta); virtual void gapAppend(double size, const NetworkCm02LinkLmmPtr link, NetworkCm02ActionLmmPtr action) {}; - NetworkCm02ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, + virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate); xbt_dynar_t getRoute(RoutingEdgePtr src, RoutingEdgePtr dst); //FIXME: kill field? That is done by the routing nowadays //FIXME: virtual void addTraces() =0; void (*f_networkSolve)(lmm_system_t) = lmm_solve; - double latencyFactor(double size); - double bandwidthFactor(double size); - double bandwidthConstraint(double rate, double bound, double size); + virtual double latencyFactor(double size); + virtual double bandwidthFactor(double size); + virtual double bandwidthConstraint(double rate, double bound, double size); bool m_haveGap = false; }; @@ -71,7 +71,7 @@ public: NetworkCm02Link(){}; NetworkCm02Link(NetworkCm02ModelPtr model, const char* name, xbt_dict_t properties) : Resource(model, name, properties) {}; virtual double getBandwidth()=0; - double getLatency(); + virtual double getLatency(); virtual bool isShared()=0; /* Using this object with the public part of model does not make sense */ @@ -81,6 +81,8 @@ public: class NetworkCm02LinkLmm : public ResourceLmm, public NetworkCm02Link { public: + NetworkCm02LinkLmm(NetworkCm02ModelPtr model, const char* name, xbt_dict_t properties) + : ResourceLmm(), NetworkCm02Link(model, name, properties) {}; NetworkCm02LinkLmm(NetworkCm02ModelPtr model, const char *name, xbt_dict_t props, lmm_system_t system, double constraint_value, @@ -104,7 +106,8 @@ public: **********/ class NetworkCm02Action : virtual public Action { public: - NetworkCm02Action(ModelPtr model, double cost, bool failed): Action(model, cost, failed) {}; + NetworkCm02Action(ModelPtr model, double cost, bool failed) + : Action(model, cost, failed) {}; double m_latency; double m_latCurrent; double m_weight; @@ -121,7 +124,10 @@ public: class NetworkCm02ActionLmm : public ActionLmm, public NetworkCm02Action { public: - NetworkCm02ActionLmm(ModelPtr model, double cost, bool failed): ActionLmm(model, cost, failed), NetworkCm02Action(model, cost, failed) {}; + NetworkCm02ActionLmm(ModelPtr model, double cost, bool failed) + : Action(model, cost, failed), + ActionLmm(model, cost, failed), + NetworkCm02Action(model, cost, failed) {}; void updateRemainingLazy(double now); void recycle(); };