1 /* Copyright (c) 2013-2015. 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 #ifndef SURF_NETWORK_CM02_HPP_
8 #define SURF_NETWORK_CM02_HPP_
12 #include "network_interface.hpp"
14 #include "xbt/graph.h"
19 class XBT_PRIVATE NetworkCm02Model;
20 class XBT_PRIVATE NetworkCm02Action;
26 XBT_PRIVATE void net_define_callbacks(void);
31 class NetworkCm02Model : public NetworkModel {
35 NetworkCm02Model(int /*i*/) : NetworkModel() {};
39 Link* createLink(const char *name,
41 tmgr_trace_t bw_trace,
43 tmgr_trace_t lat_trace,
44 e_surf_resource_state_t state_initial,
45 tmgr_trace_t state_trace,
46 e_surf_link_sharing_policy_t policy,
47 xbt_dict_t properties) override;
49 void updateActionsStateLazy(double now, double delta);
50 void updateActionsStateFull(double now, double delta);
51 Action *communicate(RoutingEdge *src, RoutingEdge *dst,
52 double size, double rate);
53 bool shareResourcesIsIdempotent() {return true;}
60 class NetworkCm02Link : public Link {
62 NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
64 double constraint_value,
65 tmgr_history_t history,
66 e_surf_resource_state_t state_init,
67 tmgr_trace_t state_trace,
69 tmgr_trace_t metric_trace,
71 tmgr_trace_t lat_trace,
72 e_surf_link_sharing_policy_t policy);
73 void updateState(tmgr_trace_event_t event_type, double value, double date);
74 void updateBandwidth(double value, double date=surf_get_clock());
75 void updateLatency(double value, double date=surf_get_clock());
83 class NetworkCm02Action : public NetworkAction {
84 friend Action *NetworkCm02Model::communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
87 NetworkCm02Action(Model *model, double cost, bool failed)
88 : NetworkAction(model, cost, failed) {};
89 void updateRemainingLazy(double now);
92 #endif /* SURF_NETWORK_CM02_HPP_ */