public:
static xbt::signal<void(DiskAction const&, Action::State, Action::State)> on_state_change;
- DiskAction(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type)
- : Action(model, cost, failed), type_(type), disk_(disk){};
-
+ DiskAction(Model* model, double cost, bool failed) : Action(model, cost, failed){};
/**
* @brief diskAction constructor
*
* @param cost The cost of this DiskAction in bytes
* @param failed [description]
* @param var The lmm variable associated to this DiskAction if it is part of a LMM component
- * @param disk The Disk associated to this DiskAction
- * @param type [description]
*/
- DiskAction(kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var, DiskImpl* disk,
- s4u::Io::OpType type)
- : Action(model, cost, failed, var), type_(type), disk_(disk){};
-
+ DiskAction(kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var)
+ : Action(model, cost, failed, var){};
void set_state(simgrid::kernel::resource::Action::State state) override;
-
- s4u::Io::OpType type_;
- DiskImpl* disk_;
};
} // namespace resource
return (new DiskS19(name, read_bandwidth, write_bandwidth))->set_model(this);
}
-double DiskS19Model::next_occurring_event(double now)
-{
- return DiskModel::next_occurring_event_full(now);
-}
-
void DiskS19Model::update_actions_state(double /*now*/, double delta)
{
for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) {
**********/
DiskS19Action::DiskS19Action(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type)
- : DiskAction(model, cost, failed, model->get_maxmin_system()->variable_new(this, 1.0, -1.0, 3), disk, type)
+ : DiskAction(model, cost, failed, model->get_maxmin_system()->variable_new(this, 1.0, -1.0, 3))
{
XBT_IN("(%s,%g", disk->get_cname(), cost);
XBT_OUT();
}
-void DiskS19Action::cancel()
-{
- set_state(Action::State::FAILED);
-}
-
-void DiskS19Action::suspend()
-{
- XBT_IN("(%p)", this);
- if (is_running()) {
- get_model()->get_maxmin_system()->update_variable_penalty(get_variable(), 0.0);
- set_suspend_state(Action::SuspendStates::SUSPENDED);
- }
- XBT_OUT();
-}
-
-void DiskS19Action::resume()
-{
- THROW_UNIMPLEMENTED;
-}
-
-void DiskS19Action::set_max_duration(double /*duration*/)
-{
- THROW_UNIMPLEMENTED;
-}
-
-void DiskS19Action::set_sharing_penalty(double)
-{
- THROW_UNIMPLEMENTED;
-}
void DiskS19Action::update_remains_lazy(double /*now*/)
{
THROW_IMPOSSIBLE;
public:
using DiskModel::DiskModel;
DiskImpl* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth) override;
- double next_occurring_event(double now) override;
void update_actions_state(double now, double delta) override;
};
class DiskS19 : public DiskImpl {
public:
- explicit DiskS19(const std::string& name, double read_bw, double write_bw): DiskImpl(name, read_bw, write_bw) {}
+ using DiskImpl::DiskImpl;
DiskAction* io_start(sg_size_t size, s4u::Io::OpType type) override;
DiskAction* read(sg_size_t size) override;
DiskAction* write(sg_size_t size) override;
class DiskS19Action : public DiskAction {
public:
DiskS19Action(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type);
- void suspend() override;
- void cancel() override;
- void resume() override;
- void set_max_duration(double duration) override;
- void set_sharing_penalty(double sharing_penalty) override;
void update_remains_lazy(double now) override;
};