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 NETWORK_CONSTANT_HPP_
8 #define NETWORK_CONSTANT_HPP_
12 #include "network_interface.hpp"
17 class XBT_PRIVATE NetworkConstantModel;
18 class XBT_PRIVATE NetworkConstantAction;
23 class NetworkConstantModel : public NetworkModel {
25 NetworkConstantModel() : NetworkModel() { };
26 ~NetworkConstantModel() { }
28 Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
29 double shareResources(double now);
30 void updateActionsState(double now, double delta);
31 bool shareResourcesIsIdempotent() {return true;}
33 Link* createLink(const char *name,
35 tmgr_trace_t bw_trace,
37 tmgr_trace_t lat_trace,
38 e_surf_resource_state_t state_initial,
39 tmgr_trace_t state_trace,
40 e_surf_link_sharing_policy_t policy,
41 xbt_dict_t properties) { DIE_IMPOSSIBLE; }
42 void addTraces() { DIE_IMPOSSIBLE; }
43 xbt_dynar_t getRoute(RoutingEdge *src, RoutingEdge *dst) { DIE_IMPOSSIBLE; }
49 class NetworkConstantAction : public NetworkAction {
51 NetworkConstantAction(NetworkConstantModel *model_, double size, double latency)
52 : NetworkAction(model_, size, false)
56 if (m_latency <= 0.0) {
57 p_stateSet = getModel()->getDoneActionSet();
58 p_stateSet->push_back(*this);
64 void setCategory(const char *category);
72 #endif /* NETWORK_CONSTANT_HPP_ */