Link* NetworkCm02Model::createLink(const char *name, double bandwidth, double latency, e_surf_link_sharing_policy_t policy, xbt_dict_t properties)
{
- xbt_assert(NULL == Link::byName(name), "Link '%s' declared several times in the platform", name);
-
- Link* link = new NetworkCm02Link(this, name, properties, maxminSystem_, sg_bandwidth_factor * bandwidth, bandwidth, latency, policy);
- Link::onCreation(link);
- return link;
+ return new NetworkCm02Link(this, name, properties, maxminSystem_, sg_bandwidth_factor * bandwidth, bandwidth, latency, policy);
}
void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/)
NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
lmm_system_t system,
double constraint_value,
- double bw_peak, double lat_initial,
+ double bandwidth, double latency,
e_surf_link_sharing_policy_t policy)
: Link(model, name, props, lmm_constraint_new(system, this, constraint_value))
{
m_bandwidth.scale = 1.0;
- m_bandwidth.peak = bw_peak;
+ m_bandwidth.peak = bandwidth;
m_latency.scale = 1.0;
- m_latency.peak = lat_initial;
+ m_latency.peak = latency;
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(getConstraint());
+
+ Link::onCreation(this);
}
public:
NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
lmm_system_t system,
- double constraint_value, double bw_peak, double lat_initial,
+ double constraint_value, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy);
void apply_event(tmgr_trace_iterator_t event, double value) override;
: Resource(model, name, constraint),
PropertyHolder(props)
{
+ if (strcmp(name,"__loopback__"))
+ xbt_assert(!Link::byName(name), "Link '%s' declared several times in the platform.", name);
+
m_latency.scale = 1;
m_bandwidth.scale = 1;
Link* NetworkNS3Model::createLink(const char *name, double bandwidth, double latency, e_surf_link_sharing_policy_t policy,
xbt_dict_t properties){
- Link* link = new LinkNS3(this, name, properties, bandwidth, latency);
- Link::onCreation(link);
- return link;
+ return new LinkNS3(this, name, properties, bandwidth, latency);
}
-Action *NetworkNS3Model::communicate(NetCard *src, NetCard *dst,
- double size, double rate)
+Action *NetworkNS3Model::communicate(NetCard *src, NetCard *dst, double size, double rate)
{
XBT_DEBUG("Communicate from %s to %s", src->name(), dst->name());
NetworkNS3Action *action = new NetworkNS3Action(this, size, 0);
{
m_bandwidth.peak = bandwidth;
m_latency.peak = latency;
+
+ Link::onCreation(this);
}
LinkNS3::~LinkNS3()
xbt_free(host_list);
}
-Action *NetworkL07Model::communicate(NetCard *src, NetCard *dst,
- double size, double rate)
+Action *NetworkL07Model::communicate(NetCard *src, NetCard *dst, double size, double rate)
{
sg_host_t*host_list = xbt_new0(sg_host_t, 2);
double *flops_amount = xbt_new0(double, 2);
Link* NetworkL07Model::createLink(const char *name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy, xbt_dict_t properties)
{
- xbt_assert(!Link::byName(name), "Link '%s' declared several times in the platform.", name);
-
- Link* link = new LinkL07(this, name, properties, bandwidth, latency, policy);
- Link::onCreation(link);
- return link;
+ return new LinkL07(this, name, properties, bandwidth, latency, policy);
}
/************
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(getConstraint());
+
+ Link::onCreation(this);
}
Action *CpuL07::execution_start(double size)