1 #ifndef CAPACITATEDVEHICLEROUTINGPROBLEM_H
2 #define CAPACITATEDVEHICLEROUTINGPROBLEM_H
27 unsigned int customers;
30 std::vector<double> demands;
33 std::vector<CoordinatesHelper> coordinates;
43 bool checkSchedule(
const std::vector<unsigned int>& schedule);
52 void writeResultToFile(
const std::vector<unsigned int>& schedule,
double costFunctionValue,
const std::string& filename);
63 CapacitatedVehicleRoutingProblem(
unsigned int customers,
const std::vector<double>& demands,
const std::vector<CoordinatesHelper>& coordinates,
double capacity);
76 CapacitatedVehicleRoutingProblem(
unsigned int customers,
double capacity,
double minDemand,
double maxDemand,
double minCoordinate,
double maxCoordinate,
bool integerValues =
false);
94 void setData(
unsigned int customers,
const std::vector<double>& demands,
const std::vector<CoordinatesHelper>& coordinates,
double capacity);
107 void generateData(
unsigned int customers,
double capacity,
double minDemand,
double maxDemand,
double minCoordinate,
double maxCoordinate,
bool integerValues =
false);
135 double evaluateCVRP(
const std::vector<unsigned int>& schedule);
145 double evaluateCVRP(
const std::vector<unsigned int>& schedule,
const std::string& filename);
182 #endif // CAPACITATEDVEHICLEROUTINGPROBLEM_H
CapacitatedVehicleRoutingProblem(unsigned int customers, const std::vector< double > &demands, const std::vector< CoordinatesHelper > &coordinates, double capacity)
Constructor.
Definition: CapacitatedVehicleRoutingProblem.cpp:11
Simple coordinates class.
Interface for reading, writing and displaying data.
Definition: BinPackingProblem.cpp:3
void writeDataToFile(const std::string &filename)
Writes capacitated vehicle routing problem data to a file with a filename.
Definition: CapacitatedVehicleRoutingProblem.cpp:300
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.
Definition: CapacitatedVehicleRoutingProblem.cpp:79
double getCapacity() const
Getter for vehicle capacity.
Definition: CapacitatedVehicleRoutingProblem.h:151
Definition: CapacitatedVehicleRoutingProblem.h:23
void readDataFromFile(const std::string &filename)
Reads capacitated vehicle routing problem data from a file with a filename.
Definition: CapacitatedVehicleRoutingProblem.cpp:145
Simple pseudo random number generator class.
const std::vector< double > & getDemands() const
Getter for demands of customers.
Definition: CapacitatedVehicleRoutingProblem.h:175
double evaluateCVRP(const std::vector< unsigned int > &schedule)
Evaluates capacitated vehicle routing problem.
Definition: CapacitatedVehicleRoutingProblem.cpp:41
void setData(unsigned int customers, const std::vector< double > &demands, const std::vector< CoordinatesHelper > &coordinates, double capacity)
Setter for capacitated vehicle routing problem data.
Definition: CapacitatedVehicleRoutingProblem.cpp:252
void showData()
Shows capacitated vehicle routing problem data.
Definition: CapacitatedVehicleRoutingProblem.cpp:287
unsigned int getCustomers() const
Getter for number of customers.
Definition: CapacitatedVehicleRoutingProblem.h:167
const std::vector< CoordinatesHelper > & getCoordinates() const
Getter for coordinates of customers.
Definition: CapacitatedVehicleRoutingProblem.h:159