1 /* Copyright (c) 2013-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "network_interface.hpp"
11 #ifndef SURF_NETWORK_CM02_HPP_
12 #define SURF_NETWORK_CM02_HPP_
17 class NetworkCm02Model;
18 class NetworkCm02Action;
24 void net_define_callbacks(void);
29 class NetworkCm02Model : public NetworkModel {
33 NetworkCm02Model(int /*i*/) : NetworkModel() {
34 f_networkSolve = lmm_solve;
36 };//FIXME: add network clean interface
40 Link* createLink(const char *name,
42 tmgr_trace_t bw_trace,
44 tmgr_trace_t lat_trace,
45 e_surf_resource_state_t state_initial,
46 tmgr_trace_t state_trace,
47 e_surf_link_sharing_policy_t policy,
48 xbt_dict_t properties);
50 void updateActionsStateLazy(double now, double delta);
51 void updateActionsStateFull(double now, double delta);
52 Action *communicate(RoutingEdge *src, RoutingEdge *dst,
53 double size, double rate);
54 bool shareResourcesIsIdempotent() {return true;}
61 class NetworkCm02Link : public Link {
63 NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
65 double constraint_value,
66 tmgr_history_t history,
67 e_surf_resource_state_t state_init,
68 tmgr_trace_t state_trace,
70 tmgr_trace_t metric_trace,
72 tmgr_trace_t lat_trace,
73 e_surf_link_sharing_policy_t policy);
74 void updateState(tmgr_trace_event_t event_type, double value, double date);
75 void updateBandwidth(double value, double date=surf_get_clock());
76 void updateLatency(double value, double date=surf_get_clock());
84 class NetworkCm02Action : public NetworkAction {
85 friend Action *NetworkCm02Model::communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
88 NetworkCm02Action(Model *model, double cost, bool failed)
89 : NetworkAction(model, cost, failed) {};
90 void updateRemainingLazy(double now);
93 #endif /* SURF_NETWORK_CM02_HPP_ */