TCPSPSuite
Public Member Functions | List of all members
Solution Class Reference

a soultion for a TCPSP instance More...

#include <solution.hpp>

Public Member Functions

 Solution (const Instance &instance, bool optimal, std::vector< Maybe< unsigned int >> &start_times, Maybe< double > lower_bound)
 
 Solution (const Instance &instance, bool optimal, std::vector< Maybe< unsigned int >> &&start_times, Maybe< double > lower_bound)
 
 Solution (const Instance &instance, bool optimal, std::vector< unsigned int > &start_times, Maybe< double > lower_bound)
 
 Solution (const Instance &instance)
 
 Solution (const Solution &other)
 
 Solution (Solution &&other)
 
Solutionoperator= (const Solution &other)
 
Solutionoperator= (Solution &&other)
 
void print () const
 
void print_jobs () const
 
void print_profile () const
 
double get_costs () const
 
double get_overshoot_costs () const
 
double get_investment_costs () const
 
double get_costs_lower_bound () const
 
const Instanceget_instance () const
 
unsigned int get_start_time (unsigned int job_id) const
 
bool job_scheduled (unsigned int job_id) const
 
bool is_feasible () const
 
bool is_optimal () const
 
double get_max_usage (unsigned int rid) const
 
Maybe< double > get_lower_bound () const
 
bool verify (int seed, InconsistentResultError *error_out=nullptr) const
 

Detailed Description

a soultion for a TCPSP instance

A solution contains for every job its start time. most of the informations get calculated on request

Constructor & Destructor Documentation

◆ Solution() [1/4]

Solution::Solution ( const Instance instance,
bool  optimal,
std::vector< Maybe< unsigned int >> &  start_times,
Maybe< double >  lower_bound 
)

Constructs a new Solution based on a vector-of-maybe

Parameters
InstanceThe instance that was solved
optimalTrue if this Solution is optimal
start_timesThe start times for each job
lower_boundlower bound found for the TCPSP instance

◆ Solution() [2/4]

Solution::Solution ( const Instance instance,
bool  optimal,
std::vector< Maybe< unsigned int >> &&  start_times,
Maybe< double >  lower_bound 
)

Constructs a new Solution based on a vector-of-maybe

Parameters
InstanceThe instance that was solved
optimalTrue if this Solution is optimal
start_timesThe start times for each job
lower_boundlower bound found for the TCPSP instance

◆ Solution() [3/4]

Solution::Solution ( const Instance instance,
bool  optimal,
std::vector< unsigned int > &  start_times,
Maybe< double >  lower_bound 
)

Constructs a new Solution based on a vector-of-uint

Warning for this constructor all jobs must have been scheduled!

Parameters
InstanceThe instance that was solved
optimalTrue if this Solution is optimal
start_timesThe start times for each job
lower_boundlower bound found for the TCPSP instance

◆ Solution() [4/4]

Solution::Solution ( const Instance instance)
explicit

"Default" constructor creates an obviously not feasible solution

Member Function Documentation

◆ get_costs()

double Solution::get_costs ( ) const

get the costs for this solution

Returns
the actual cost or INF if the solution is not feasible

◆ get_costs_lower_bound()

double Solution::get_costs_lower_bound ( ) const

Get the costs for this solution

Returns
the actual cost

◆ get_instance()

const Instance * Solution::get_instance ( ) const

Get the TCPSP instance that was solved

Returns
the solved TCPSP instance

◆ get_lower_bound()

Maybe< double > Solution::get_lower_bound ( ) const

get the lower bound for the TCPSP instance

Returns
the lower bound

◆ get_max_usage()

double Solution::get_max_usage ( unsigned int  rid) const

Returns the maximum usage of the geven resource

Parameters
ridthe resource id
Returns
the maximum usage of the given resource

◆ get_start_time()

unsigned int Solution::get_start_time ( unsigned int  job_id) const

Get the start time for the given job Warning If the job was not scheduled this is undefined!

Parameters
job_idthe job to get the start time for
Returns
the start time of the job

◆ is_feasible()

bool Solution::is_feasible ( ) const

checks if this solution is feasible Warning currently only checks if all jobs are scheduled

Returns
true if the solutio is feasible

◆ is_optimal()

bool Solution::is_optimal ( ) const

checks if this solution is optimal Warning this is true if the solver says so!

Returns
true if this solution is optimal

◆ job_scheduled()

bool Solution::job_scheduled ( unsigned int  job_id) const

checks if a job is scheduled

Parameters
job_idthe job to check
Returns
true if the job was scheduled

◆ print()

void Solution::print ( ) const

logs generell informations about this solution (for example the costs of this Solution)

◆ print_jobs()

void Solution::print_jobs ( ) const

logs for every job the time it starts and the last time it runs

◆ print_profile()

void Solution::print_profile ( ) const

logs the profile

◆ verify()

bool Solution::verify ( int  seed,
InconsistentResultError *  error_out = nullptr 
) const

verifies that this solution is correct all constraints are met


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