Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

SJob Class Reference

#include <SJob.h>

Inherits STypeInfo, and SObservable.

Inherited by SBroadcastRequ [virtual], SParallelJob [virtual], and SShopJob [virtual].

Inheritance diagram for SJob:

Inheritance graph
[legend]
List of all members.

Public Types

enum  State {
  HIDDEN, RELEASED, RUNNING, FINISHED,
  REJECTED
}

Public Methods

 SJob (SProbabilityDist *dist)
 SJob (double proctime=1.0)
virtual ~SJob ()
virtual void reset ()
int getIndex () const
virtual double getProcTime ()
virtual double getRemProcTime () const
bool isFinished () const
double getReleaseTime () const
double getDueTime () const
double getStartTime (int operation=0) const
const leda_array< double > & getStartTimes () const
const STopologygetTopology () const
const double getWeight () const
State getState () const
virtual void setState (State s)
bool getOverDue () const
virtual void setOverDue ()
virtual SJobModgetModifier ()=0
virtual double getNextEventTime (double currTime) const
void simulate (double oldTime, double newTime)
virtual void process (SMachines &machines, double duration)=0
double getExpProcTime ()
SProbabilityDistgetProcTimeDist ()
bool hasRandProcTime ()
virtual leda_string getClassifier () const=0
virtual bool isInstanceOf (const leda_string &classifier) const=0
virtual void assureInstanceOf (const leda_string &classifier) const=0
void addObserver (SObserver &obs)
void deleteObserver (SObserver &obs)
void notifyObservers (const SEvent &event)

Public Attributes

SPref_pref

Protected Methods

void advanceProcTime (double by)
const SPrefgetPref () const

Friends

class SJobMod

Detailed Description

The base class for all jobs, handles the processing state (what is being done with it, how long does it still need to be processed etc). Change properties of the job by accessing the modifier !


Member Enumeration Documentation

enum SJob::State
 

Defined states of a job: HIDDEN (not yet released and so cannot be scheduled), RELEASED (can be scheduled, but is not running at the moment), RUNNING, FINISHED (job is completely finished i.e. for shop jobs all operations are finished)

Enumeration values:
HIDDEN 
RELEASED 
RUNNING 
FINISHED 
REJECTED 


Constructor & Destructor Documentation

SJob::SJob SProbabilityDist   dist
 

Constructor. Do not try to make an instance of SJob, always take a derived class !

SJob::SJob double    proctime = 1.0
 

SJob::~SJob   [virtual]
 

Destructor.


Member Function Documentation

void SObservable::addObserver SObserver   obs [inline, inherited]
 

Here another component can register himself as observer of this component

Parameters:
obs  observer that wants to be notified of events created by this class

void SJob::advanceProcTime double    by [protected]
 

Record the amount of time for which the job has already been processed. The job is finished if the total processing time is reached. Called by process()

virtual void STypeInfo::assureInstanceOf const leda_string &    classifier const [pure virtual, inherited]
 

The same as isInstanceOf(), only that the program is stopped with an error in case of failure

Parameters:
classifier  e.g. "P", "Q", "R", etc

void SObservable::deleteObserver SObserver   obs [inline, inherited]
 

Here another component can delete himself from the list of observers of this component

Parameters:
obs  observer that doesn't want to be notified anymore

virtual leda_string STypeInfo::getClassifier   [pure virtual, inherited]
 

Get the classifier of the object, using the classification scheme. E.g. "P" for Identical Processors

Returns:
classifier string

double SJob::getDueTime   const [inline]
 

Get time when the execution of the job must be finished (= due date).

double SJob::getExpProcTime   [inline]
 

int SJob::getIndex   const [inline]
 

Get the index of the job.

virtual SJobMod& SJob::getModifier   [pure virtual]
 

Get access to the modifier. Here you can change properties of the job.

Returns:
the modifier for the job

Implemented in SAtomarJob, SBroadcastRequ, SMalleableJob, SParallelJob, and SShopJob.

double SJob::getNextEventTime double    currTime const [virtual]
 

Return the next time an event will happen after the current time

Parameters:
currTime  the current simulation time
Returns:
the time when the next event will by generated the job

bool SJob::getOverDue   const [inline]
 

Return if job has passed its due date

const SPref& SJob::getPref   const [inline, protected]
 

get read-only access to the preferences instance

double SJob::getProcTime   [virtual]
 

Get total relative processing time of the job. Interpreted according to the job model: it is assumed that the whole job is executed with normalized speed

Reimplemented in SMalleableJob.

SProbabilityDist * SJob::getProcTimeDist  
 

No descriptions

double SJob::getReleaseTime   const [inline]
 

Get time when the job becomes released.

virtual double SJob::getRemProcTime   const [inline, virtual]
 

Get remaining relative processing time of the job. I Interpreted according to the job model.

double SJob::getStartTime int    operation = 0 const [inline]
 

Get time when the job gets running.

const leda_array<double>& SJob::getStartTimes   const [inline]
 

Get all start times.

State SJob::getState   const [inline]
 

Get the state of the job

const STopology& SJob::getTopology   const [inline]
 

Get topology of job

const double SJob::getWeight   const [inline]
 

bool SJob::hasRandProcTime  
 

No descriptions

bool SJob::isFinished   const [inline]
 

Return if job is finished. A job is finished if its remaining relative processing time is zero.

virtual bool STypeInfo::isInstanceOf const leda_string &    classifier const [pure virtual, inherited]
 

Checks whether the object is an instance of the specified or a specialized class

Parameters:
classifier  e.g. "P", "Q", "R", etc
Returns:
true if the object can be casted to the specified class

void SObservable::notifyObservers const SEvent   event [inline, inherited]
 

Inform all observers of this component about an event. The Observers will receive this event by their SObserver::update()-method.

Parameters:
event  an event that is sent to all observers of this component
See also:
SObserver::update()

virtual void SJob::process SMachines   machines,
double    duration
[pure virtual]
 

This method is called by SMachines during simulatedUntil(). It records which part of the job has already been processed and changes the state of the job if appropriate.

Parameters:
machines  the SMachines class which calls process
duration  the amount of time which shall be simulated

Implemented in SAtomarJob, SBroadcastRequ, SMalleableJob, SParallelJob, and SShopJob.

void SJob::reset   [virtual]
 

Reset job. Set remaining processing time to the processing time of the job, set state to HIDDEN, set it to be "in due time" and notify observers of JOBRESET

Reimplemented in SShopJob.

void SJob::setOverDue   [virtual]
 

Do not call this from the outside. Should only be called by simulate()

void SJob::setState State    s [virtual]
 

Do not call this from the outside. Set the new state and generate JOBSTATECHANGED, only used by SMachines!!

void SJob::simulate double    oldTime,
double    newTime
 

Advance the simulation time until the next time step. CAUTION: This method does not simulate the processing of the job on a machine. This is done by process() which is called by SMachines::simulate(). simulate() only handles events which concern the job itself (not the pair job/machine), e.g. release time and due date

Parameters:
oldTime  the time from which the simulation time is advanced.
newTime  the time up to which the simulation time is advanced.


Friends And Related Function Documentation

friend class SJobMod [friend]
 


Member Data Documentation

SPref& SJob::_pref
 

reference to preference instance


The documentation for this class was generated from the following files:
Generated on Thu May 22 16:50:46 2003 for Sketch-it! by doxygen1.2.18