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_
10 #include "network_interface.hpp"
15 class NetworkConstantModel;
16 class NetworkConstantAction;
21 class NetworkConstantModel : public NetworkModel {
23 NetworkConstantModel() : NetworkModel() { };
24 ~NetworkConstantModel() { }
26 Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate);
27 double shareResources(double now);
28 void updateActionsState(double now, double delta);
29 bool shareResourcesIsIdempotent() {return true;}
31 Link* createLink(const char *name,
33 tmgr_trace_t bw_trace,
35 tmgr_trace_t lat_trace,
36 e_surf_resource_state_t state_initial,
37 tmgr_trace_t state_trace,
38 e_surf_link_sharing_policy_t policy,
39 xbt_dict_t properties) { DIE_IMPOSSIBLE; }
40 void addTraces() { DIE_IMPOSSIBLE; }
41 xbt_dynar_t getRoute(RoutingEdge *src, RoutingEdge *dst) { DIE_IMPOSSIBLE; }
47 class NetworkConstantAction : public NetworkAction {
49 NetworkConstantAction(NetworkConstantModel *model_, double size, double latency)
50 : NetworkAction(model_, size, false)
54 if (m_latency <= 0.0) {
55 p_stateSet = getModel()->getDoneActionSet();
56 p_stateSet->push_back(*this);
62 void setCategory(const char *category);
70 #endif /* NETWORK_CONSTANT_HPP_ */