fpmas 1.6
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
fpmas::runtime::Runtime Class Reference

#include <runtime.h>

Inheritance diagram for fpmas::runtime::Runtime:
Inheritance graph
[legend]
Collaboration diagram for fpmas::runtime::Runtime:
Collaboration graph
[legend]

Public Member Functions

 Runtime (api::scheduler::Scheduler &scheduler)
 
void run (Date end) override
 
void run (Date start, Date end) override
 
void execute (const api::scheduler::Job &job) override
 
void execute (const api::scheduler::JobList &job_list) override
 
Date currentDate () const override
 
void setCurrentDate (Date date) override
 
virtual void run (Date start, Date end)=0
 
virtual void run (Date end)=0
 
virtual void execute (const scheduler::Job &job)=0
 
virtual void execute (const scheduler::JobList &job_list)=0
 
virtual Date currentDate () const =0
 
virtual void setCurrentDate (Date date)=0
 

Static Public Member Functions

static void seed (random::DistributedGenerator<>::result_type seed)
 

Static Public Attributes

static random::DistributedGenerator distributed_rd
 

Detailed Description

api::runtime::Runtime implementation.

Constructor & Destructor Documentation

◆ Runtime()

fpmas::runtime::Runtime::Runtime ( api::scheduler::Scheduler scheduler)
inline

Runtime constructor.

Parameters
schedulerscheduler to execute

Member Function Documentation

◆ run() [1/2]

void fpmas::runtime::Runtime::run ( Date  end)
overridevirtual

Runs jobs from currentDate() to end, excluded.

Equivalent to

this->run(this->currentDate(), end);
void run(Date end) override
Definition: runtime.cpp:18
Date currentDate() const override
Definition: runtime.h:45
Parameters
endend date
See also
run(Date, Date)

Implements fpmas::api::runtime::Runtime.

◆ run() [2/2]

void fpmas::runtime::Runtime::run ( Date  start,
Date  end 
)
overridevirtual

Runs jobs from start, included, to end, excluded.

The Runtime is currently based on a unit time step. In consequence, the Runtime will execute jobs at dates start, start+1 and start+n for any integer n such that start+n < end.

At the end of the execution, currentDate() is reinitialized to 0.

Parameters
startstart date
endend date

Implements fpmas::api::runtime::Runtime.

◆ execute() [1/2]

void fpmas::runtime::Runtime::execute ( const api::scheduler::Job job)
overridevirtual

Executes the provided job.

Tasks of the job (excluding scheduler::Job::getBeginTask() and scheduler::Job::getEndTask()) are executed in a random order.

Parameters
jobjob to execute

Implements fpmas::api::runtime::Runtime.

◆ execute() [2/2]

void fpmas::runtime::Runtime::execute ( const api::scheduler::JobList job_list)
overridevirtual

Sequentially executes the jobs contained in the provided job_list.

Parameters
job_listlist of jobs to execute sequentially

Implements fpmas::api::runtime::Runtime.

◆ currentDate()

Date fpmas::runtime::Runtime::currentDate ( ) const
inlineoverridevirtual

Current internal date of the runtime.

The current date is initialized to 0 when a Runtime is built.

Returns
current date of this Runtime

Implements fpmas::api::runtime::Runtime.

◆ setCurrentDate()

void fpmas::runtime::Runtime::setCurrentDate ( Date  date)
inlineoverridevirtual

Sets the internal date of this Runtime, so that the next call to run(Date) will start to run jobs from date.

Parameters
datenew date

Implements fpmas::api::runtime::Runtime.

◆ seed()

void fpmas::runtime::Runtime::seed ( random::DistributedGenerator<>::result_type  seed)
static

Seeds the internal static random number generator used to produce execution sequences at each epoch.

Parameters
seedrandom seed

Member Data Documentation

◆ distributed_rd

random::DistributedGenerator fpmas::runtime::Runtime::distributed_rd
static

Static and distributed random number generator used to determine the execution order of Tasks within each Job. It can be be seeded with the seed() method.


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