VRPH  1.0
inc/VRPSolution.h
Go to the documentation of this file.
00001 
00002 //                                                        //
00003 // This file is part of the VRPH software package for     //
00004 // generating solutions to vehicle routing problems.      //
00005 // VRPH was developed by Chris Groer (cgroer@gmail.com).  //
00006 //                                                        //
00007 // (c) Copyright 2010 Chris Groer.                        //
00008 // All Rights Reserved.  VRPH is licensed under the       //
00009 // Common Public License.  See LICENSE file for details.  //
00010 //                                                        //
00012 
00013 #ifndef _VRP_SOLUTION_H
00014 #define _VRP_SOLUTION_H
00015 
00016 class VRPSolution
00017 {
00021 
00022 public:
00023         VRPSolution();
00024         VRPSolution(int n);
00025         ~VRPSolution();
00026 
00027         bool in_IP;             // Flag to tell if the solution has been added to the IP before
00028         double obj;             // objective function value
00029         int n;                  // # of non-DEPOT nodes in the solution
00030         int *sol;               // Place for a solution buffer
00031         double time;    // time at which the solution was first discovered
00032         int hash(int salt);     
00033 
00034 };
00035 
00036 class VRPSolutionWarehouse
00037 {
00038 public:
00039 
00040         VRPSolutionWarehouse();
00041         ~VRPSolutionWarehouse();
00042 
00043         VRPSolutionWarehouse(int num_sols, int n);
00044 
00045         
00046         int num_sols;
00047         int max_size;
00048         double worst_obj;
00049         VRPSolution *sols;
00050         struct htable_entry* hash_table;
00051 
00052         int add_sol(VRPSolution *new_sol, int start_index);
00053         bool liquidate();
00054         void sort_sols();
00055         void show();
00056         
00057 
00058 };
00059 
00060 
00061 #endif
00062