VRPH  1.0
Public Member Functions | Public Attributes
VRPSolutionWarehouse Class Reference

#include <VRPSolution.h>

List of all members.

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
VRPSolutionsols
struct htable_entryhash_table

Detailed Description

Definition at line 36 of file VRPSolution.h.


Constructor & Destructor Documentation

Default constructor for the solution warehouse.

Definition at line 16 of file VRPSolution.cpp.

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.


Member Function Documentation

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.

Removes all solutions from the warehouse.

Definition at line 211 of file VRPSolution.cpp.

Debugging function to show the current solutions in the warehouse.

Definition at line 189 of file VRPSolution.cpp.

Sorts the solutions in the warehouse in increasing order of the objective function value.

Definition at line 244 of file VRPSolution.cpp.


Member Data Documentation

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.


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