return action;
}
-Host *HostL07Model::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props)
-{
- return new HostL07(this, name, props, netElm, cpu);
-}
-
Action *NetworkL07Model::communicate(RoutingEdge *src, RoutingEdge *dst,
double size, double rate)
{
return res;
}
-xbt_dynar_t HostL07Model::getRoute(Host *src, Host *dst)
-{
- xbt_dynar_t route=NULL;
- routing_platf->getRouteAndLatency(src->p_netElm, dst->p_netElm, &route, NULL);
- return route;
-}
-
-Cpu *CpuL07Model::createCpu(const char *name, xbt_dynar_t powerPeak,
+Cpu *CpuL07Model::createCpu(simgrid::Host *host, xbt_dynar_t powerPeak,
int pstate, double power_scale,
tmgr_trace_t power_trace, int core,
e_surf_resource_state_t state_initial,
tmgr_trace_t state_trace)
{
double power_initial = xbt_dynar_get_as(powerPeak, pstate, double);
- CpuL07 *cpu = new CpuL07(this, name, power_initial, power_scale, power_trace,
+ CpuL07 *cpu = new CpuL07(this, host, power_initial, power_scale, power_trace,
core, state_initial, state_trace);
return cpu;
}
lat_initial, lat_trace,
state_initial, state_trace,
policy);
- surf_callback_emit(networkLinkCreatedCallbacks, link);
+ Link::onCreation(link);
return link;
}
/************
* Resource *
************/
-
-HostL07::HostL07(HostModel *model, const char* name, xbt_dict_t props, RoutingEdge *netElm, Cpu *cpu)
- : Host(model, name, props, NULL, netElm, cpu)
-{
-}
-
-CpuL07::CpuL07(CpuL07Model *model, const char* name,
+CpuL07::CpuL07(CpuL07Model *model, simgrid::Host *host,
double speedInitial, double speedScale, tmgr_trace_t speedTrace,
int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace)
- : Cpu(model, name, lmm_constraint_new(ptask_maxmin_system, this, speedInitial * speedScale),
+ : Cpu(model, host, lmm_constraint_new(ptask_maxmin_system, this, speedInitial * speedScale),
core, speedInitial, speedScale, state_initial)
{
xbt_assert(m_speedScale > 0, "Power has to be >0");
p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);
}
+CpuL07::~CpuL07()
+{
+}
+
LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
double bw_initial,
tmgr_trace_t bw_trace,
return;
}
-e_surf_resource_state_t HostL07::getState() {
- return p_cpu->getState();
-}
-
-
double LinkL07::getBandwidth()
{
return m_bwCurrent;