- xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)),
- "Host '%s' declared several times in the platform file",
- name);
- CpuTiPtr cpu = new CpuTi(this, name, powerPeak, pstate, powerScale, powerTrace,
- core, stateInitial, stateTrace, cpuProperties);
- xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, static_cast<ResourcePtr>(cpu));
- return (CpuTiPtr) xbt_lib_get_elm_or_null(host_lib, name);
-}
-
-CpuTiActionPtr CpuTiModel::createAction(double /*cost*/, bool /*failed*/)
-{
- return NULL;//new CpuTiAction(this, cost, failed);
+ xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0,
+ "Speed has to be >0.0. Did you forget to specify the mandatory speed attribute?");
+ CpuTi *cpu = new CpuTi(this, host, speedPeak, pstate, speedScale, speedTrace,
+ core, initiallyOn, stateTrace);
+ return cpu;