SimGrid  3.12
Versatile Simulation of Distributed Systems
Action Class Reference

SURF action interface class. More...

#include <surf_interface.hpp>

Inheritance diagram for Action:
CpuAction HostAction NetworkAction StorageAction

Public Member Functions

 Action (Model *model, double cost, bool failed)
 Action constructor. More...
 
 Action (Model *model, double cost, bool failed, lmm_variable_t var)
 Action constructor. More...
 
virtual ~Action ()
 Destructor.
 
void finish ()
 Mark that the action is now finished.
 
e_surf_action_state_t getState ()
 Get the state of the current Action. More...
 
virtual void setState (e_surf_action_state_t state)
 Set the state of the current Action.
 
double getBound ()
 Get the bound of the current Action.
 
void setBound (double bound)
 Set the bound of the current Action.
 
double getStartTime ()
 Get the start time of the current action.
 
double getFinishTime ()
 Get the finish time of the current action.
 
void * getData ()
 Get the user data associated to the current action.
 
void setData (void *data)
 Set the user data associated to the current action.
 
double getCost ()
 Get the cost of the current action.
 
void setCost (double cost)
 Set the cost of the current action.
 
void updateMaxDuration (double delta)
 Update the maximum duration of the current action. More...
 
void updateRemains (double delta)
 Update the remaining time of the current action. More...
 
void setRemains (double value)
 Set the remaining time of the current action.
 
virtual double getRemains ()
 Get the remaining time of the current action after updating the resource.
 
double getRemainsNoUpdate ()
 Get the remaining time of the current action without updating the resource.
 
void setFinishTime (double value)
 Set the finish time of the current action.
 
void ref ()
 Add a reference to the current action (refcounting)
 
virtual int unref ()
 Unref that action (and destroy it if refcount reaches 0) More...
 
virtual void cancel ()
 Cancel the current Action if running.
 
virtual void suspend ()
 Suspend the current Action.
 
virtual void resume ()
 Resume the current Action.
 
virtual bool isSuspended ()
 Returns true if the current action is running.
 
double getMaxDuration ()
 Get the maximum duration of the current action.
 
virtual void setMaxDuration (double duration)
 Set the maximum duration of the current Action.
 
char * getCategory ()
 Get the tracing category associated to the current action.
 
void setCategory (const char *category)
 Set the tracing category of the current Action.
 
double getPriority ()
 Get the priority of the current Action.
 
virtual void setPriority (double priority)
 Set the priority of the current Action.
 
ActionList * getStateSet ()
 Get the state set in which the action is.
 

Protected Attributes

double m_priority
 
double m_remains
 
double m_finish
 

Detailed Description

SURF action interface class.

An action is an event generated by a resource (e.g.: a communication for the network)

Constructor & Destructor Documentation

Action::Action ( Model model,
double  cost,
bool  failed 
)

Action constructor.

Parameters
modelThe Model associated to this Action
costThe cost of the Action
failedIf the action is impossible (e.g.: execute something on a switched off host)
Action::Action ( Model model,
double  cost,
bool  failed,
lmm_variable_t  var 
)

Action constructor.

Parameters
modelThe Model associated to this Action
costThe cost of the Action
failedIf the action is impossible (e.g.: execute something on a switched off host)
varThe lmm variable associated to this Action if it is part of a LMM component

Member Function Documentation

e_surf_action_state_t Action::getState ( )

Get the state of the current Action.

get the state

void Action::updateMaxDuration ( double  delta)
inline

Update the maximum duration of the current action.

Parameters
deltaAmount to remove from the MaxDuration
void Action::updateRemains ( double  delta)
inline

Update the remaining time of the current action.

Parameters
deltaAmount to remove from the remaining time
int Action::unref ( )
virtual

Unref that action (and destroy it if refcount reaches 0)

Returns
true if the action was destroyed and false if someone still has references on it

Field Documentation

double Action::m_priority
protected

priority (1.0 by default)

double Action::m_remains
protected

How much of that cost remains to be done in the currently running task

double Action::m_finish
protected

finish time : this is modified during the run and fluctuates until the task is completed


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