1 /* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "cpu_interface.hpp"
17 class XBT_PRIVATE CpuCas01Model;
18 class XBT_PRIVATE CpuCas01;
19 class XBT_PRIVATE CpuCas01Action;
25 class CpuCas01Model : public simgrid::surf::CpuModel {
30 Cpu *createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
31 tmgr_trace_t speedTrace, int core, tmgr_trace_t state_trace) override;
32 double next_occuring_event_full(double now) override;
33 ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
40 class CpuCas01 : public Cpu {
42 CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
43 tmgr_trace_t speedTrace, int core, tmgr_trace_t stateTrace) ;
45 void apply_event(tmgr_trace_iterator_t event, double value) override;
46 CpuAction *execution_start(double size) override;
47 CpuAction *sleep(double duration) override;
49 bool isUsed() override;
51 xbt_dynar_t getSpeedPeakList(); // FIXME: killme to hide our internals
54 void onSpeedChange() override;
60 class CpuCas01Action: public CpuAction {
61 friend CpuAction *CpuCas01::execution_start(double size);
62 friend CpuAction *CpuCas01::sleep(double duration);
64 CpuCas01Action(Model *model, double cost, bool failed, double speed,
65 lmm_constraint_t constraint);