TCPSPSuite
|
a TCPSP instance More...
#include <instance.hpp>
Public Member Functions | |
void | swap (Instance &other) |
Instance & | operator= (Instance other) |
Instance (const Instance &other) | |
Instance (Instance &&other) | |
Instance () | |
Instance (const std::string instance_id, Traits wanted_traits) | |
Instance (const Instance &origin, std::vector< bool > &&job_is_substituted, std::vector< Job > &&substitutions) | |
LagGraph & | get_laggraph () |
const LagGraph & | get_laggraph () const |
unsigned int | add_job (Job &&job) |
unsigned int | add_resource (Resource &&resource) |
unsigned int | job_count () const |
const Job & | get_job (unsigned int i) const |
const JobContainer & | get_jobs () const |
unsigned int | resource_count () const |
const Resource & | get_resource (unsigned int i) const |
const Traits & | get_traits () const |
void | compute_traits () |
const std::string & | get_id () const |
Instance | clone () const |
bool | check_feasibility () const |
void | set_window_extension (unsigned int window_extension_limit, unsigned int window_extension_job_limit) |
Setter for the window extension parameters. More... | |
void | set_window_extension_hard_deadline (Maybe< unsigned int > deadline) |
unsigned int | get_window_extension_limit () const |
unsigned int | get_window_extension_job_limit () const |
Maybe< unsigned int > | get_window_extension_hard_deadline () const |
double | calculate_max_costs (const std::vector< unsigned int > &start_times) const |
double | calculate_costs (const ResVec &ressource_usage, const ResVec &additional_usage) const |
double | calculate_costs (const ResVec &ressource_usage) const |
unsigned int | get_latest_deadline () const |
Helper to return the latest deadline in the instance. More... | |
a TCPSP instance
A TCPSP instance consists of the folowing data:
Instance::Instance | ( | ) |
Default constructor creates an empty instance without an id
Instance::Instance | ( | const std::string | instance_id, |
Traits | wanted_traits | ||
) |
Constructs a new instance with a name and sets the instance should have
instance_id | the id of this instance |
wanted_traits | the traits this should have |
Instance::Instance | ( | const Instance & | origin, |
std::vector< bool > && | job_is_substituted, | ||
std::vector< Job > && | substitutions | ||
) |
Constructs a new instance based on another instance
origin | the instance this should be based on |
job_is_substituted | a vector-of-bool stating for every job if it is substituted or not |
substitutions | the substitutions |
unsigned int Instance::add_job | ( | Job && | job | ) |
adds a job to this instance
job | that should be added |
unsigned int Instance::add_resource | ( | Resource && | resource | ) |
adds a resource to this instance
resource | that should be added |
double Instance::calculate_costs | ( | const ResVec & | ressource_usage | ) | const |
calculates the cost of a given resource usage
Warning This metho currently uses flat resources!!! TODO change this!
ressource_usage | the base usage of all resources |
double Instance::calculate_costs | ( | const ResVec & | ressource_usage, |
const ResVec & | additional_usage | ||
) | const |
calculates the cost of a given resource usage
Warning This metho currently uses flat resources!!! TODO change this!
ressource_usage | the base usage of all resources |
additional_usage | the additional usage of all resources |
TODO what the hell? What is this function for?
double Instance::calculate_max_costs | ( | const std::vector< unsigned int > & | start_times | ) | const |
calculates the cost of a given solution in form of a vector of start times (it is NOT validated if the solution is correct!)
Warning This metho currently uses flat resources!!! TODO change this!
start_times | the start times for each job |
bool Instance::check_feasibility | ( | ) | const |
checks if the created instance is feasible if CRASH_ON_CHECK this will throw an assertion error instead of returning!
Instance Instance::clone | ( | ) | const |
Returns a deep copy of this instance
void Instance::compute_traits | ( | ) |
computes the traits this instance actually fulfills Warning this throws an assertion error if the wanted traits are not fulfilled!
const std::string & Instance::get_id | ( | ) | const |
Returns the id of this instance
const Job & Instance::get_job | ( | unsigned int | i | ) | const |
Returns the job with the given index
const Instance::JobContainer & Instance::get_jobs | ( | ) | const |
Returns a container with all jobs of this instance
const LagGraph & Instance::get_laggraph | ( | ) |
Returns the lag graph
const LagGraph& Instance::get_laggraph | ( | ) | const |
Returns the lag graph
unsigned int Instance::get_latest_deadline | ( | ) | const |
Helper to return the latest deadline in the instance.
const Resource & Instance::get_resource | ( | unsigned int | i | ) | const |
Returns the resource with the given index
const Traits & Instance::get_traits | ( | ) | const |
Returns all traits this instance fulfills (not only wanted ones)
unsigned int Instance::job_count | ( | ) | const |
Returns the number of jobs this instance has
unsigned int Instance::resource_count | ( | ) | const |
Returns the number of resourcec this instance has
void Instance::set_window_extension | ( | unsigned int | window_extension_limit, |
unsigned int | window_extension_job_limit | ||
) |
Setter for the window extension parameters.
window_extension_limit | The total number of time steps that windows may be extended |
window_extension_job_limit | The maximum number of jobs that may have their windows extended |