SimGrid
3.21
Versatile Simulation of Distributed Systems
|
An action is a consumption on a resource (e.g.: a communication for the network).
It is related (but still different) from activities, that are the stuff on which an actor can be blocked. See simgrid::s4u::Activity for more details.
#include <Action.hpp>
Public Types | |
enum | State { State::INITED, State::STARTED, State::FAILED, State::FINISHED, State::IGNORED } |
enum | SuspendStates { SuspendStates::not_suspended = 0, SuspendStates::suspended, SuspendStates::sleeping } |
typedef boost::intrusive::list< Action, boost::intrusive::member_hook< Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_ > > | ModifiedSet |
typedef boost::intrusive::list< Action, boost::intrusive::member_hook< Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_ > > | StateSet |
Public Member Functions | |
bool | is_within_modified_set () const |
Action (Model *model, double cost, bool failed) | |
Action constructor. More... | |
Action (Model *model, double cost, bool failed, lmm::Variable *var) | |
Action constructor. More... | |
virtual | ~Action () |
void | finish (Action::State state) |
Mark that the action is now finished. More... | |
Action::State | get_state () const |
Get the state of the current Action. More... | |
virtual void | set_state (Action::State state) |
Set the state of the current Action. More... | |
double | get_bound () const |
Get the bound of the current Action. More... | |
void | set_bound (double bound) |
Set the bound of the current Action. More... | |
double | get_start_time () const |
Get the start time of the current action. More... | |
double | get_finish_time () const |
Get the finish time of the current action. More... | |
void * | get_data () const |
Get the user data associated to the current action. More... | |
void | set_data (void *data) |
Set the user data associated to the current action. More... | |
double | get_cost () const |
Get the cost of the current action. More... | |
void | set_cost (double cost) |
Set the cost of the current action. More... | |
void | update_max_duration (double delta) |
Update the maximum duration of the current action. More... | |
void | update_remains (double delta) |
Update the remaining time of the current action. More... | |
virtual void | update_remains_lazy (double now)=0 |
void | set_remains (double value) |
Set the remaining time of the current action. More... | |
virtual double | get_remains () |
Get the remaining time of the current action after updating the resource. More... | |
double | get_remains_no_update () const |
Get the remaining time of the current action without updating the resource. More... | |
void | set_finish_time (double value) |
Set the finish time of the current action. More... | |
void | ref () |
Add a reference to the current action (refcounting) More... | |
bool | unref () |
Unref that action (and destroy it if refcount reaches 0) More... | |
virtual void | cancel () |
Cancel the current Action if running. More... | |
virtual void | suspend () |
Suspend the current Action. More... | |
virtual void | resume () |
Resume the current Action. More... | |
bool | is_suspended () |
Returns true if the current action is running. More... | |
double | get_max_duration () const |
Get the maximum duration of the current action. More... | |
virtual void | set_max_duration (double duration) |
Set the maximum duration of the current Action. More... | |
std::string | get_category () const |
Get the tracing category associated to the current action. More... | |
void | set_category (std::string category) |
Set the tracing category of the current Action. More... | |
double | get_priority () const |
Get the priority of the current Action. More... | |
virtual void | set_priority (double priority) |
Set the priority of the current Action. More... | |
void | set_priority_no_update (double priority) |
StateSet * | get_state_set () const |
Get the state set in which the action is. More... | |
simgrid::kernel::resource::Model * | get_model () const |
ActionHeap::Type | get_type () const |
lmm::Variable * | get_variable () const |
void | set_variable (lmm::Variable *var) |
double | get_last_update () const |
void | set_last_update () |
double | get_last_value () const |
void | set_last_value (double val) |
Public Attributes | |
boost::intrusive::list_member_hook | modified_set_hook_ |
boost::intrusive::list_member_hook | state_set_hook_ |
Protected Attributes | |
StateSet * | state_set_ |
Action::SuspendStates | suspended_ = Action::SuspendStates::not_suspended |
typedef boost::intrusive::list< Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::modified_set_hook_> > simgrid::kernel::resource::Action::ModifiedSet |
typedef boost::intrusive::list< Action, boost::intrusive::member_hook<Action, boost::intrusive::list_member_hook<>, &Action::state_set_hook_> > simgrid::kernel::resource::Action::StateSet |
|
strong |
|
strong |
Enumerator | |
---|---|
not_suspended | Action currently not suspended. |
suspended | |
sleeping |
simgrid::kernel::resource::Action::Action | ( | Model * | model, |
double | cost, | ||
bool | failed | ||
) |
simgrid::kernel::resource::Action::Action | ( | Model * | model, |
double | cost, | ||
bool | failed, | ||
lmm::Variable * | var | ||
) |
|
virtual |
|
inline |
void simgrid::kernel::resource::Action::finish | ( | Action::State | state | ) |
Action::State simgrid::kernel::resource::Action::get_state | ( | ) | const |
|
virtual |
double simgrid::kernel::resource::Action::get_bound | ( | ) | const |
Get the bound of the current Action.
void simgrid::kernel::resource::Action::set_bound | ( | double | bound | ) |
Set the bound of the current Action.
|
inline |
Get the start time of the current action.
|
inline |
Get the finish time of the current action.
|
inline |
Get the user data associated to the current action.
|
inline |
Set the user data associated to the current action.
|
inline |
Get the cost of the current action.
|
inline |
Set the cost of the current action.
void simgrid::kernel::resource::Action::update_max_duration | ( | double | delta | ) |
Update the maximum duration of the current action.
delta | Amount to remove from the MaxDuration |
void simgrid::kernel::resource::Action::update_remains | ( | double | delta | ) |
Update the remaining time of the current action.
delta | Amount to remove from the remaining time |
|
pure virtual |
|
inline |
Set the remaining time of the current action.
|
virtual |
Get the remaining time of the current action after updating the resource.
|
inline |
Get the remaining time of the current action without updating the resource.
|
inline |
Set the finish time of the current action.
void simgrid::kernel::resource::Action::ref | ( | ) |
Add a reference to the current action (refcounting)
bool simgrid::kernel::resource::Action::unref | ( | ) |
Unref that action (and destroy it if refcount reaches 0)
|
virtual |
Cancel the current Action if running.
|
virtual |
Suspend the current Action.
|
virtual |
Resume the current Action.
bool simgrid::kernel::resource::Action::is_suspended | ( | ) |
Returns true if the current action is running.
|
inline |
Get the maximum duration of the current action.
|
virtual |
Set the maximum duration of the current Action.
|
inline |
Get the tracing category associated to the current action.
|
inline |
Set the tracing category of the current Action.
|
inline |
Get the priority of the current Action.
|
virtual |
Set the priority of the current Action.
|
inline |
|
inline |
Get the state set in which the action is.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void simgrid::kernel::resource::Action::set_last_update | ( | ) |
|
inline |
|
inline |
boost::intrusive::list_member_hook simgrid::kernel::resource::Action::modified_set_hook_ |
boost::intrusive::list_member_hook simgrid::kernel::resource::Action::state_set_hook_ |
|
protected |
|
protected |