Operational Research Library  1.0
Public Member Functions | List of all members
operational_research::QuadraticAssignmentProblem Class Reference

#include <QuadraticAssignmentProblem.h>

Inheritance diagram for operational_research::QuadraticAssignmentProblem:
Inheritance graph
Collaboration diagram for operational_research::QuadraticAssignmentProblem:
Collaboration graph

Public Member Functions

 QuadraticAssignmentProblem (unsigned int objects, const std::vector< std::vector< double > > &flows, const std::vector< std::vector< double > > &distances, const std::vector< std::vector< double > > &costs)
 Constructor. More...
 
 QuadraticAssignmentProblem (unsigned int objects, double minFlow, double maxFlow, double minDistance, double maxDistance, double minCost, double maxCost, bool integerValues=false)
 Constructor. More...
 
 QuadraticAssignmentProblem (const std::string &filename)
 Constructor. More...
 
void setData (unsigned int objects, const std::vector< std::vector< double > > &flows, const std::vector< std::vector< double > > &distances, const std::vector< std::vector< double > > &costs)
 Setter for quadratic assignment problem data. More...
 
void generateData (unsigned int objects, double minFlow, double maxFlow, double minDistance, double maxDistance, double minCost, double maxCost, bool integerValues=false)
 Generates quadratic assignment problem data according to setup. More...
 
void readDataFromFile (const std::string &filename)
 Reads quadratic assignment problem data from a file with a filename. More...
 
void writeDataToFile (const std::string &filename)
 Writes quadratic assignment problem data to a file with a filename. More...
 
void showData ()
 Shows quadratic assignment problem data. More...
 
double evaluateQAP (const std::vector< unsigned int > &schedule)
 Evaluates quadratic assignment problem. More...
 
double evaluateQAP (const std::vector< unsigned int > &schedule, const std::string &filename)
 Evaluates quadratic assignment problem to file with a filename. More...
 
double evaluateQBAP (const std::vector< unsigned int > &schedule)
 Evaluates quadratic bottleneck assignment problem. More...
 
double evaluateQBAP (const std::vector< unsigned int > &schedule, const std::string &filename)
 Evaluates quadratic bottleneck assignment problem to file with a filename. More...
 
const std::vector< std::vector< double > > & getCosts () const
 Getter for costs. More...
 
const std::vector< std::vector< double > > & getDistances () const
 Getter for distances. More...
 
const std::vector< std::vector< double > > & getFlows () const
 Getter for flows. More...
 
unsigned int getObjects () const
 Getter for number of objects. More...
 
- Public Member Functions inherited from operational_research::IData
virtual ~IData ()
 Virtual destructor. More...
 

Detailed Description

Author
Milan Hlinak
Date
04/14/15

Constructor & Destructor Documentation

operational_research::QuadraticAssignmentProblem::QuadraticAssignmentProblem ( unsigned int  objects,
const std::vector< std::vector< double > > &  flows,
const std::vector< std::vector< double > > &  distances,
const std::vector< std::vector< double > > &  costs 
)

Constructor.

Parameters
objectsNumber of objects.
flowsFlows.
distancesDistances.
costsCosts of assignment.
Exceptions
std::invalid_argumentexception.
operational_research::QuadraticAssignmentProblem::QuadraticAssignmentProblem ( unsigned int  objects,
double  minFlow,
double  maxFlow,
double  minDistance,
double  maxDistance,
double  minCost,
double  maxCost,
bool  integerValues = false 
)

Constructor.

Parameters
objectsNumber of objects.
minFlowMinimal flow.
maxFlowMaximal flow.
minDistanceMinimal distance.
maxDistanceMaximal distance.
minCostMinimal cost of assignment.
maxCostMaximal cost of assignment.
integerValuesTrue if generated data is integer values, false if generated data is real values.
Exceptions
std::invalid_argumentexception.
operational_research::QuadraticAssignmentProblem::QuadraticAssignmentProblem ( const std::string &  filename)

Constructor.

Parameters
filenameFilename.
Exceptions
std::runtime_errorexception.
std::invalid_argumentexception.

Member Function Documentation

double operational_research::QuadraticAssignmentProblem::evaluateQAP ( const std::vector< unsigned int > &  schedule)

Evaluates quadratic assignment problem.

Parameters
scheduleSchedule.
Returns
Cost function value for given schedule.
Exceptions
std::invalid_argumentexception.
double operational_research::QuadraticAssignmentProblem::evaluateQAP ( const std::vector< unsigned int > &  schedule,
const std::string &  filename 
)

Evaluates quadratic assignment problem to file with a filename.

Parameters
scheduleSchedule.
filenameFilename.
Returns
Cost function value for given schedule.
Exceptions
std::invalid_argumentexception.
std::runtime_errorexception.
double operational_research::QuadraticAssignmentProblem::evaluateQBAP ( const std::vector< unsigned int > &  schedule)

Evaluates quadratic bottleneck assignment problem.

Parameters
scheduleSchedule.
Returns
Cost function value for given schedule.
Exceptions
std::invalid_argumentexception.
double operational_research::QuadraticAssignmentProblem::evaluateQBAP ( const std::vector< unsigned int > &  schedule,
const std::string &  filename 
)

Evaluates quadratic bottleneck assignment problem to file with a filename.

Parameters
scheduleSchedule.
filenameFilename.
Returns
Cost function value for given schedule.
Exceptions
std::invalid_argumentexception.
std::runtime_errorexception.
void operational_research::QuadraticAssignmentProblem::generateData ( unsigned int  objects,
double  minFlow,
double  maxFlow,
double  minDistance,
double  maxDistance,
double  minCost,
double  maxCost,
bool  integerValues = false 
)

Generates quadratic assignment problem data according to setup.

Parameters
objectsNumber of objects.
minFlowMinimal flow.
maxFlowMaximal flow.
minDistanceMinimal distance.
maxDistanceMaximal distance.
minCostMinimal cost of assignment.
maxCostMaximal cost of assignment.
integerValuesTrue if generated data is integer values, false if generated data is real values.
Exceptions
std::invalid_argumentexception.
const std::vector<std::vector<double> >& operational_research::QuadraticAssignmentProblem::getCosts ( ) const
inline

Getter for costs.

Returns
Costs.
const std::vector<std::vector<double> >& operational_research::QuadraticAssignmentProblem::getDistances ( ) const
inline

Getter for distances.

Returns
Distances.
const std::vector<std::vector<double> >& operational_research::QuadraticAssignmentProblem::getFlows ( ) const
inline

Getter for flows.

Returns
Flows.
unsigned int operational_research::QuadraticAssignmentProblem::getObjects ( ) const
inline

Getter for number of objects.

Returns
Number of objects.
void operational_research::QuadraticAssignmentProblem::readDataFromFile ( const std::string &  filename)
virtual

Reads quadratic assignment problem data from a file with a filename.

Parameters
filenameFilename.
Exceptions
std::runtime_errorexception.
std::invalid_argumentexception.

Implements operational_research::IData.

void operational_research::QuadraticAssignmentProblem::setData ( unsigned int  objects,
const std::vector< std::vector< double > > &  flows,
const std::vector< std::vector< double > > &  distances,
const std::vector< std::vector< double > > &  costs 
)

Setter for quadratic assignment problem data.

Parameters
objectsNumber of objects.
flowsFlows.
distancesDistances.
costsCosts of assignment.
Exceptions
std::invalid_argumentexception.
void operational_research::QuadraticAssignmentProblem::showData ( )
virtual

Shows quadratic assignment problem data.

Implements operational_research::IData.

void operational_research::QuadraticAssignmentProblem::writeDataToFile ( const std::string &  filename)
virtual

Writes quadratic assignment problem data to a file with a filename.

Parameters
filenameFilename.
Exceptions
std::runtime_errorexception.

Implements operational_research::IData.


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