A job of an TCPSP instance.
More...
#include <job.hpp>
|
using | JobId = unsigned int |
|
A job of an TCPSP instance.
A job of a TCPSP instance. Each job is associated with a set of attributes:
- An id: Uniquely identifies this job.
- A duration: Specifies for how long the job must be executed (without being interrupted).
- A release: Specifies the first time step in which the job may be executed.
- A deadline: Specifies the first time step in which the job must be finished.
- One usage specification per resource: Specifies how much this job uses of a given resource during its execution.
◆ Job() [1/2]
Job::Job |
( |
unsigned int |
release, |
|
|
unsigned int |
deadline, |
|
|
unsigned int |
duration, |
|
|
ResVec |
usages, |
|
|
unsigned int |
id |
|
) |
| |
Constructs a job from its release time, deadline, duration, usages and its ID.
- Parameters
-
release | The release time of the job to be created |
deadline | The deadline of the job to be created |
duration | The duration of the job to be created |
usages | A vector of usage specifications. usages[i] specifies how much of resource with ID i this job requires. |
id | The ID of the job to be created. |
◆ Job() [2/2]
Job::Job |
( |
unsigned int |
release, |
|
|
unsigned int |
deadline, |
|
|
const Job & |
other |
|
) |
| |
Creates a job as a copy of another job (with the same ID!), allowing to modify release and deadline.
Warning: Never add this job to the same instance as the <other> job. Both jobs have the same ID, and two jobs with the same ID within the same instance produces undefined behavior.
- Parameters
-
release | The release time of the new job |
deadline | The deadline of the new job |
other | The original job from which all other values are taken. |
◆ clone()
Performs a deep copy of this job.
- Returns
- A cloned version of this job.
◆ get_deadline()
unsigned int Job::get_deadline |
( |
| ) |
const |
Returns the deadline of the job.
- Returns
- The deadline of the job.
◆ get_duration()
unsigned int Job::get_duration |
( |
| ) |
const |
Returns the duration of the job.
- Returns
- The duration of the job.
◆ get_hint()
Maybe< unsigned int > Job::get_hint |
( |
| ) |
const |
Returns the start-time hint, if set
- Returns
- The start-time hint
◆ get_jid()
unsigned int Job::get_jid |
( |
| ) |
const |
Returns the ID of the job.
- Returns
- The ID of the job.
◆ get_release()
unsigned int Job::get_release |
( |
| ) |
const |
Returns the release of the job.
- Returns
- The release of the job.
◆ get_resource_usage() [1/2]
const ResVec & Job::get_resource_usage |
( |
| ) |
const |
Returns how much of all resources this Job uses.
- Returns
- the amount of resource used for each resource
◆ get_resource_usage() [2/2]
double Job::get_resource_usage |
( |
unsigned int |
rid | ) |
const |
Returns how much of a certain resource this job uses.
- Parameters
-
rid | The ID of the resource one is interested about |
- Returns
- The amount of resource with ID <rid> that this job uses
◆ set_hint()
void Job::set_hint |
( |
Maybe< unsigned int > |
hint | ) |
|
Sets the start-time hint of the job. This hint may be used by solvers to speed up solving.
- Parameters
-
hint | The hint to be used, or Maybe<unsigned int>{} for no hint. |
◆ set_id()
void Job::set_id |
( |
unsigned int |
id | ) |
|
Sets the ID of the job.
Warning: Changing the ID of the job after the lag graph has been initialized breaks the instance. Only use this if you know what you are doing.
- Parameters
-
id | The new ID of this job. |
The documentation for this class was generated from the following files:
- /home/lukas/src/tcpsp/github/src/instance/job.hpp
- /home/lukas/src/tcpsp/github/src/instance/job.cpp