SimGrid  3.21
Versatile Simulation of Distributed Systems
simgrid::kernel::resource::Model Class Reference

Detailed Description

SURF model interface class.

A model is an object which handle the interactions between its Resources and its Actions

#include <Model.hpp>

Public Types

enum  UpdateAlgo { UpdateAlgo::FULL, UpdateAlgo::LAZY }
 Possible update mechanisms. More...
 

Public Member Functions

 Model (Model::UpdateAlgo algo)
 
virtual ~Model ()
 
Action::StateSetget_inited_action_set () const
 Get the set of actions in inited state. More...
 
Action::StateSetget_started_action_set () const
 Get the set of actions in started state. More...
 
Action::StateSetget_failed_action_set () const
 Get the set of actions in failed state. More...
 
Action::StateSetget_finished_action_set () const
 Get the set of actions in finished state. More...
 
Action::StateSetget_ignored_action_set () const
 Get the set of actions in ignored state. More...
 
Action::ModifiedSetget_modified_set () const
 Get the set of modified actions. More...
 
lmm::System * get_maxmin_system () const
 Get the maxmin system of the current Model. More...
 
void set_maxmin_system (lmm::System *system)
 Set the maxmin system of the current Model. More...
 
UpdateAlgo get_update_algorithm () const
 Get the update algorithm of the current Model. More...
 
ActionHeapget_action_heap ()
 Get Action heap. More...
 
virtual double next_occuring_event (double now)
 Share the resources between the actions. More...
 
virtual double next_occuring_event_lazy (double now)
 
virtual double next_occuring_event_full (double now)
 
Actionextract_done_action ()
 
Actionextract_failed_action ()
 
virtual void update_actions_state (double now, double delta)
 Update action to the current time. More...
 
virtual void update_actions_state_lazy (double now, double delta)
 
virtual void update_actions_state_full (double now, double delta)
 
virtual bool next_occuring_event_is_idempotent ()
 Returns whether this model have an idempotent share_resource() More...
 

Member Enumeration Documentation

◆ UpdateAlgo

Possible update mechanisms.

Enumerator
FULL 

Full update mechanism: the remaining time of every action is recomputed at each step.

LAZY 

Lazy update mechanism: only the modified actions get recomputed.

It may be slower than full if your system is tightly coupled to the point where every action gets recomputed anyway. In that case, you'd better not try to be cleaver with lazy and go for a simple full update.

Constructor & Destructor Documentation

◆ Model()

simgrid::kernel::resource::Model::Model ( Model::UpdateAlgo  algo)
explicit

◆ ~Model()

virtual simgrid::kernel::resource::Model::~Model ( )
virtual

Member Function Documentation

◆ get_inited_action_set()

Action::StateSet* simgrid::kernel::resource::Model::get_inited_action_set ( ) const
inline

Get the set of actions in inited state.

◆ get_started_action_set()

Action::StateSet* simgrid::kernel::resource::Model::get_started_action_set ( ) const
inline

Get the set of actions in started state.

◆ get_failed_action_set()

Action::StateSet* simgrid::kernel::resource::Model::get_failed_action_set ( ) const
inline

Get the set of actions in failed state.

◆ get_finished_action_set()

Action::StateSet* simgrid::kernel::resource::Model::get_finished_action_set ( ) const
inline

Get the set of actions in finished state.

◆ get_ignored_action_set()

Action::StateSet* simgrid::kernel::resource::Model::get_ignored_action_set ( ) const
inline

Get the set of actions in ignored state.

◆ get_modified_set()

Action::ModifiedSet* simgrid::kernel::resource::Model::get_modified_set ( ) const

Get the set of modified actions.

◆ get_maxmin_system()

lmm::System* simgrid::kernel::resource::Model::get_maxmin_system ( ) const
inline

Get the maxmin system of the current Model.

◆ set_maxmin_system()

void simgrid::kernel::resource::Model::set_maxmin_system ( lmm::System *  system)
inline

Set the maxmin system of the current Model.

◆ get_update_algorithm()

UpdateAlgo simgrid::kernel::resource::Model::get_update_algorithm ( ) const
inline

Get the update algorithm of the current Model.

◆ get_action_heap()

ActionHeap& simgrid::kernel::resource::Model::get_action_heap ( )
inline

Get Action heap.

◆ next_occuring_event()

virtual double simgrid::kernel::resource::Model::next_occuring_event ( double  now)
virtual

Share the resources between the actions.

Parameters
nowThe current time of the simulation
Returns
The delta of time till the next action will finish

◆ next_occuring_event_lazy()

virtual double simgrid::kernel::resource::Model::next_occuring_event_lazy ( double  now)
virtual

◆ next_occuring_event_full()

virtual double simgrid::kernel::resource::Model::next_occuring_event_full ( double  now)
virtual

◆ extract_done_action()

Action* simgrid::kernel::resource::Model::extract_done_action ( )

◆ extract_failed_action()

Action* simgrid::kernel::resource::Model::extract_failed_action ( )

◆ update_actions_state()

virtual void simgrid::kernel::resource::Model::update_actions_state ( double  now,
double  delta 
)
virtual

Update action to the current time.

Parameters
nowThe current time of the simulation
deltaThe delta of time since the last update

◆ update_actions_state_lazy()

virtual void simgrid::kernel::resource::Model::update_actions_state_lazy ( double  now,
double  delta 
)
virtual

◆ update_actions_state_full()

virtual void simgrid::kernel::resource::Model::update_actions_state_full ( double  now,
double  delta 
)
virtual

◆ next_occuring_event_is_idempotent()

virtual bool simgrid::kernel::resource::Model::next_occuring_event_is_idempotent ( )
inlinevirtual

Returns whether this model have an idempotent share_resource()

The only model that is not is NS3: computing the next timestamp moves the model up to that point, so we need to call it only when the next timestamp of other sources is computed.


The documentation for this class was generated from the following file: