Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
CpuCas01 in C++
[simgrid.git] / src / surf / cpu_cas01.hpp
1 #include "cpu.hpp"
2
3 /***********
4  * Classes *
5  ***********/
6 class CpuCas01Model;
7 typedef CpuCas01Model *CpuCas01ModelPtr;
8
9 class CpuCas01Lmm;
10 typedef CpuCas01Lmm *CpuCas01LmmPtr;
11
12 class CpuCas01ActionLmm;
13 typedef CpuCas01ActionLmm *CpuCas01ActionLmmPtr;
14
15 /*********
16  * Model *
17  *********/
18 class CpuCas01Model : public CpuModel {
19 public:
20   CpuCas01Model();
21   ~CpuCas01Model();
22
23   double (CpuCas01Model::*shareResources)(double now);
24   void (CpuCas01Model::*updateActionsState)(double now, double delta);
25
26   void parseInit(sg_platf_host_cbarg_t host);  
27   CpuCas01LmmPtr createResource(const char *name, double power_peak, double power_scale,
28                           tmgr_trace_t power_trace, int core,
29                           e_surf_resource_state_t state_initial,
30                           tmgr_trace_t state_trace,
31                           xbt_dict_t cpu_properties);
32   double shareResourcesFull(double now);  
33   void addTraces();
34 };
35
36 /************
37  * Resource *
38  ************/
39 class CpuCas01Lmm : public CpuLmm {
40 public:
41   CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, double powerPeak,
42         double powerScale, tmgr_trace_t powerTrace, int core,
43         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
44         xbt_dict_t properties) ;
45   void updateState(tmgr_trace_event_t event_type, double value, double date);
46   CpuActionPtr execute(double size);
47   CpuActionPtr sleep(double duration);
48
49   bool isUsed();
50
51   tmgr_trace_event_t p_powerEvent;
52 };
53
54 /**********
55  * Action *
56  **********/
57 class CpuCas01ActionLmm: public CpuActionLmm {
58 public:
59   CpuCas01ActionLmm() {};
60   CpuCas01ActionLmm(ModelPtr model, double cost, bool failed): CpuActionLmm(model, cost, failed) {};
61   int unref() {return 0;};//TODO
62   void cancel() {};//TODO
63   void recycle() {};//TODO
64 };