class CpuCas01Model;
typedef CpuCas01Model *CpuCas01ModelPtr;
-class CpuCas01Lmm;
-typedef CpuCas01Lmm *CpuCas01LmmPtr;
+class CpuCas01;
+typedef CpuCas01 *CpuCas01Ptr;
-class CpuCas01ActionLmm;
-typedef CpuCas01ActionLmm *CpuCas01ActionLmmPtr;
+class CpuCas01Action;
+typedef CpuCas01Action *CpuCas01ActionPtr;
/*********
* Model *
xbt_dict_t cpu_properties);
double shareResourcesFull(double now);
void addTraces();
- xbt_swag_t p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
+ ActionListPtr p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
};
/************
double last_updated; /*< Timestamp of the last energy update event*/
} s_energy_cpu_cas01_t, *energy_cpu_cas01_t;
-class CpuCas01Lmm : public CpuLmm {
+class CpuCas01 : public Cpu {
+public://FIXME:
+ tmgr_trace_event_t p_stateEvent;
public:
- CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, xbt_dynar_t power_peak,
+ CpuCas01(CpuCas01ModelPtr model, const char *name, xbt_dynar_t power_peak,
int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
xbt_dict_t properties) ;
- ~CpuCas01Lmm();
+ ~CpuCas01();
void updateState(tmgr_trace_event_t event_type, double value, double date);
- ActionPtr execute(double size);
- ActionPtr sleep(double duration);
-
- xbt_dynar_t getWattsRangeList();
- double getCurrentWattsValue(double cpu_load);
- void updateEnergy(double cpu_load);
+ CpuActionPtr execute(double size);
+ CpuActionPtr sleep(double duration);
double getCurrentPowerPeak();
double getPowerPeakAt(int pstate_index);
int getNbPstates();
void setPowerPeakAt(int pstate_index);
- double getConsumedEnergy();
bool isUsed();
tmgr_trace_event_t p_powerEvent;
-
xbt_dynar_t p_powerPeakList; /*< List of supported CPU capacities */
int m_pstate; /*< Current pstate (index in the power_peak_list)*/
- energy_cpu_cas01_t p_energy; /*< Structure with energy-consumption data */
};
/**********
* Action *
**********/
-class CpuCas01ActionLmm: public CpuActionLmm {
+class CpuCas01Action: public CpuAction {
+ friend CpuActionPtr CpuCas01::execute(double size);
+ friend CpuActionPtr CpuCas01::sleep(double duration);
public:
- CpuCas01ActionLmm() {};
- CpuCas01ActionLmm(ModelPtr model, double cost, bool failed): Action(model, cost, failed), CpuActionLmm(model, cost, failed) {};
- ~CpuCas01ActionLmm() {};
- void updateEnergy();
+ CpuCas01Action() {};
+ CpuCas01Action(ModelPtr model, double cost, bool failed, double power, lmm_constraint_t constraint);
+
+ ~CpuCas01Action() {};
};