SimGrid  3.11
Versatile Simulation of Distributed Systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Action Class Reference

SURF action interface class. More...

#include <surf_interface.hpp>

Inheritance diagram for Action:
CpuAction NetworkAction StorageAction WorkstationAction

Public Member Functions

 Action (ModelPtr model, double cost, bool failed)
 Action constructor. More...
 
 Action (ModelPtr model, double cost, bool failed, lmm_variable_t var)
 Action constructor. More...
 
virtual ~Action ()
 Action destructor.
 
void finish ()
 Finish the action.
 
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. More...
 
double getBound ()
 Get the bound of the current Action. More...
 
void setBound (double bound)
 Set the bound of the current Action. More...
 
double getStartTime ()
 Get the start time of the current action. More...
 
double getFinishTime ()
 Get the finish time of the current action. More...
 
void * getData ()
 Get the data associated to the current action. More...
 
void setData (void *data)
 Set the data associated to the current action. More...
 
double getMaxDuration ()
 Get the maximum duration of the current action. More...
 
char * getCategory ()
 Get the category associated to the current action. More...
 
double getCost ()
 Get the cost of the current action. More...
 
void setCost (double cost)
 Set the cost of the current action. More...
 
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. More...
 
void setFinishTime (double value)
 Set the finish time of the current action. More...
 
void ref ()
 Add a reference to the current action.
 
virtual int unref ()
 Remove a reference to the current action. More...
 
virtual void cancel ()
 Cancel the current Action if running.
 
virtual void recycle ()
 Recycle an Action.
 
virtual void suspend ()
 Suspend the current Action.
 
virtual void resume ()
 Resume the current Action.
 
virtual bool isSuspended ()
 Check if the current action is running. More...
 
virtual void setMaxDuration (double duration)
 Set the maximum duration of the current Action. More...
 
virtual void setPriority (double priority)
 Set the priority of the current Action. More...
 
void setCategory (const char *category)
 Set the category of the current Action. More...
 
virtual double getRemains ()
 Get the remaining time of the current action after updating the resource. More...
 
double getRemainsNoUpdate ()
 Get the remaining time of the current action without updating the resource. More...
 
double getPriority ()
 Get the priority of the current Action. More...
 
ActionListPtr getStateSet ()
 Get the state set in which the action is. More...
 

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 ( ModelPtr  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 workstation)
Action::Action ( ModelPtr  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 workstation)
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.

Returns
The state of the current Actionget the state
void Action::setState ( e_surf_action_state_t  state)
virtual

Set the state of the current Action.

Parameters
stateThe new state of the current Action

Reimplemented in WorkstationAction, NetworkAction, StorageAction, and CpuAction.

double Action::getBound ( )

Get the bound of the current Action.

Returns
The bound of the current Action
void Action::setBound ( double  bound)

Set the bound of the current Action.

Parameters
boundThe new bound of the current Action
double Action::getStartTime ( )

Get the start time of the current action.

Returns
The start time of the current action
double Action::getFinishTime ( )

Get the finish time of the current action.

Returns
The finish time of the current action
void* Action::getData ( )
inline

Get the data associated to the current action.

Returns
The data associated to the current action
void Action::setData ( void *  data)

Set the data associated to the current action.

Parameters
dataThe new data associated to the current action
double Action::getMaxDuration ( )
inline

Get the maximum duration of the current action.

Returns
The maximum duration of the current action
char* Action::getCategory ( )
inline

Get the category associated to the current action.

Returns
The category associated to the current action
double Action::getCost ( )
inline

Get the cost of the current action.

Returns
The cost of the current action
void Action::setCost ( double  cost)
inline

Set the cost of the current action.

Parameters
costThe new cost of the current action
void Action::updateMaxDuration ( double  delta)
inline

Update the maximum duration of the current action.

Parameters
delta[TODO]
void Action::updateRemains ( double  delta)
inline

Update the remaining time of the current action.

Parameters
delta[TODO]
void Action::setRemains ( double  value)
inline

Set the remaining time of the current action.

Parameters
valueThe new remaining time of the current action
void Action::setFinishTime ( double  value)
inline

Set the finish time of the current action.

Parameters
valueThe new Finush time of the current action
int Action::unref ( )
virtual

Remove a reference to the current action.

If the Action has no more reference, we destroy it

Returns
true if the action was destroyed and false if someone still has references on it
bool Action::isSuspended ( )
virtual

Check if the current action is running.

Returns
true if the current Action is suspended, false otherwise
void Action::setMaxDuration ( double  duration)
virtual

Set the maximum duration of the current Action.

Parameters
durationThe new maximum duration of the current Action
void Action::setPriority ( double  priority)
virtual

Set the priority of the current Action.

Parameters
priorityThe new priority of the current Action
void Action::setCategory ( const char *  category)

Set the category of the current Action.

Parameters
categoryThe new category of the current Action
double Action::getRemains ( )
virtual

Get the remaining time of the current action after updating the resource.

Returns
The remaining time
double Action::getRemainsNoUpdate ( )

Get the remaining time of the current action without updating the resource.

Returns
The remaining time
double Action::getPriority ( )
inline

Get the priority of the current Action.

Returns
The priority of the current Action
ActionListPtr Action::getStateSet ( )
inline

Get the state set in which the action is.

[TODO]

Returns
The state set in which the action is

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: