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_ROUTE_H 00014 #define _VRP_ROUTE_H 00015 00016 00017 #define MAX_NEIGHBORING_ROUTES 5 00018 #define DUPLICATE_ROUTE 0 00019 #define OVERWRITTEN_ROUTE 1 00020 #define ADDED_ROUTE 2 00021 #define BETTER_ROUTE 3 00022 00023 00024 class VRPRoute 00025 { 00031 public: 00032 00033 VRPRoute(); 00034 VRPRoute(int n); 00035 ~VRPRoute(); 00036 00037 int start; 00038 int end; 00039 double length; 00040 int load; 00041 int num_customers; 00042 double obj_val; 00043 00044 int hash_val; 00045 int hash_val2; 00046 00047 double total_service_time; 00048 double time; 00049 double *x; 00050 double *y; 00051 00052 char *name; // Used when we add a route to an IP as a column 00053 00054 double x_center; 00055 double y_center; 00056 00057 double min_theta; 00058 double max_theta; 00059 00060 int neighboring_routes[MAX_NEIGHBORING_ROUTES]; 00061 00062 int *ordering; 00063 00064 void create_name(); 00065 00066 int hash(int salt); 00067 00068 }; 00069 00070 00071 class VRPRouteWarehouse 00072 { 00073 public: 00074 VRPRouteWarehouse(); 00075 VRPRouteWarehouse(int h_size); 00076 ~VRPRouteWarehouse(); 00077 00078 int hash_table_size; 00079 int num_unique_routes; 00080 struct htable_entry* hash_table; 00081 00082 void remove_route(int hash_val, int hash_val2); 00083 int add_route(VRPRoute *R); 00084 void liquidate(); 00085 00086 00087 }; 00088 #endif 00089