VRPH
1.0
|
#include <VRPSolution.h>
Public Member Functions | |
VRPSolutionWarehouse () | |
~VRPSolutionWarehouse () | |
VRPSolutionWarehouse (int num_sols, int n) | |
int | add_sol (VRPSolution *new_sol, int start_index) |
bool | liquidate () |
void | sort_sols () |
void | show () |
Public Attributes | |
int | num_sols |
int | max_size |
double | worst_obj |
VRPSolution * | sols |
struct htable_entry * | hash_table |
Definition at line 36 of file VRPSolution.h.
VRPSolutionWarehouse::VRPSolutionWarehouse | ( | ) |
Default constructor for the solution warehouse.
Definition at line 16 of file VRPSolution.cpp.
VRPSolutionWarehouse::~VRPSolutionWarehouse | ( | ) |
Destructor for the solution warehouse.
Definition at line 53 of file VRPSolution.cpp.
VRPSolutionWarehouse::VRPSolutionWarehouse | ( | int | num_sols, |
int | n | ||
) |
Constructs a warehouse of max_sols solutions, with sufficient memory for an n-node problem.
Definition at line 29 of file VRPSolution.cpp.
int VRPSolutionWarehouse::add_sol | ( | VRPSolution * | new_sol, |
int | start_index | ||
) |
Attempts to add a solution to the warehouse. Returns the index that the new solution was placed at. Returns -1 if the solution was not placed in the warehouse. The start_index provides a place to begin the search -- useful when inserting multiple solutions whose order is already known. Use start_index=0 if no information about the solution's position is known. The VRPSolution being passed in should be in "canonical form" for the hash function to work properly!!
Definition at line 70 of file VRPSolution.cpp.
bool VRPSolutionWarehouse::liquidate | ( | ) |
Removes all solutions from the warehouse.
Definition at line 211 of file VRPSolution.cpp.
void VRPSolutionWarehouse::show | ( | ) |
Debugging function to show the current solutions in the warehouse.
Definition at line 189 of file VRPSolution.cpp.
void VRPSolutionWarehouse::sort_sols | ( | ) |
Sorts the solutions in the warehouse in increasing order of the objective function value.
Definition at line 244 of file VRPSolution.cpp.
Definition at line 50 of file VRPSolution.h.
Definition at line 47 of file VRPSolution.h.
Definition at line 46 of file VRPSolution.h.
Definition at line 49 of file VRPSolution.h.
Definition at line 48 of file VRPSolution.h.