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

#include <CapacitatedVehicleRoutingProblem.h>

Inheritance diagram for operational_research::CapacitatedVehicleRoutingProblem:
Inheritance graph
Collaboration diagram for operational_research::CapacitatedVehicleRoutingProblem:
Collaboration graph

Public Member Functions

 CapacitatedVehicleRoutingProblem (unsigned int customers, const std::vector< double > &demands, const std::vector< CoordinatesHelper > &coordinates, double capacity)
 Constructor. More...
 
 CapacitatedVehicleRoutingProblem (unsigned int customers, double capacity, double minDemand, double maxDemand, double minCoordinate, double maxCoordinate, bool integerValues=false)
 Constructor. More...
 
 CapacitatedVehicleRoutingProblem (const std::string &filename)
 Constructor. More...
 
void setData (unsigned int customers, const std::vector< double > &demands, const std::vector< CoordinatesHelper > &coordinates, double capacity)
 Setter for capacitated vehicle routing problem data. More...
 
void generateData (unsigned int customers, double capacity, double minDemand, double maxDemand, double minCoordinate, double maxCoordinate, bool integerValues=false)
 Generates capacitated vehicle routing problem data according to setup. More...
 
void readDataFromFile (const std::string &filename)
 Reads capacitated vehicle routing problem data from a file with a filename. More...
 
void writeDataToFile (const std::string &filename)
 Writes capacitated vehicle routing problem data to a file with a filename. More...
 
void showData ()
 Shows capacitated vehicle routing problem data. More...
 
double evaluateCVRP (const std::vector< unsigned int > &schedule)
 Evaluates capacitated vehicle routing problem. More...
 
double evaluateCVRP (const std::vector< unsigned int > &schedule, const std::string &filename)
 Evaluates capacitated vehicle routing problem to file with a filename. More...
 
double getCapacity () const
 Getter for vehicle capacity. More...
 
const std::vector< CoordinatesHelper > & getCoordinates () const
 Getter for coordinates of customers. More...
 
unsigned int getCustomers () const
 Getter for number of customers. More...
 
const std::vector< double > & getDemands () const
 Getter for demands of customers. 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::CapacitatedVehicleRoutingProblem::CapacitatedVehicleRoutingProblem ( unsigned int  customers,
const std::vector< double > &  demands,
const std::vector< CoordinatesHelper > &  coordinates,
double  capacity 
)

Constructor.

Parameters
customersNumber of customers.
demandsDemands of customers.
coordinatesCoordinates of depot and customers.
capacityVehicle capacity.
Exceptions
std::invalid_argumentexception.
operational_research::CapacitatedVehicleRoutingProblem::CapacitatedVehicleRoutingProblem ( unsigned int  customers,
double  capacity,
double  minDemand,
double  maxDemand,
double  minCoordinate,
double  maxCoordinate,
bool  integerValues = false 
)

Constructor.

Parameters
customersNumber of customers.
capacityVehicle capacity.
minDemandMinimal demand of customer.
maxDemandMaximal demand of customer.
minCoordinateMinimal coordinate.
maxCoordinateMaximal coordinate.
integerValuesTrue if generated data is integer values, false if generated data is real values.
Exceptions
std::invalid_argumentexception.
operational_research::CapacitatedVehicleRoutingProblem::CapacitatedVehicleRoutingProblem ( const std::string &  filename)

Constructor.

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

Member Function Documentation

double operational_research::CapacitatedVehicleRoutingProblem::evaluateCVRP ( const std::vector< unsigned int > &  schedule)

Evaluates capacitated vehicle routing problem.

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

Evaluates capacitated vehicle routing 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::CapacitatedVehicleRoutingProblem::generateData ( unsigned int  customers,
double  capacity,
double  minDemand,
double  maxDemand,
double  minCoordinate,
double  maxCoordinate,
bool  integerValues = false 
)

Generates capacitated vehicle routing problem data according to setup.

Parameters
customersNumber of customers.
capacityVehicle capacity.
minDemandMinimal demand of customer.
maxDemandMaximal demand of customer.
minCoordinateMinimal coordinate.
maxCoordinateMaximal coordinate.
integerValuesTrue if generated data is integer values, false if generated data is real values.
Exceptions
std::invalid_argumentexception.
double operational_research::CapacitatedVehicleRoutingProblem::getCapacity ( ) const
inline

Getter for vehicle capacity.

Returns
Vehicle capacity.
const std::vector<CoordinatesHelper>& operational_research::CapacitatedVehicleRoutingProblem::getCoordinates ( ) const
inline

Getter for coordinates of customers.

Returns
Coordinates of customers.
unsigned int operational_research::CapacitatedVehicleRoutingProblem::getCustomers ( ) const
inline

Getter for number of customers.

Returns
Number of customers
const std::vector<double>& operational_research::CapacitatedVehicleRoutingProblem::getDemands ( ) const
inline

Getter for demands of customers.

Returns
Demands of customers.
void operational_research::CapacitatedVehicleRoutingProblem::readDataFromFile ( const std::string &  filename)
virtual

Reads capacitated vehicle routing problem data from a file with a filename.

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

Implements operational_research::IData.

void operational_research::CapacitatedVehicleRoutingProblem::setData ( unsigned int  customers,
const std::vector< double > &  demands,
const std::vector< CoordinatesHelper > &  coordinates,
double  capacity 
)

Setter for capacitated vehicle routing problem data.

Parameters
customersNumber of customers.
demandsDemands of customers.
coordinatesCoordinates of depot and customers.
capacityVehicle capacity.
Exceptions
std::invalid_argumentexception.
void operational_research::CapacitatedVehicleRoutingProblem::showData ( )
virtual

Shows capacitated vehicle routing problem data.

Implements operational_research::IData.

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

Writes capacitated vehicle routing 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: