Closed shulaxan closed 9 years ago
Try this out:
It will create a result.txt file which contains all the results.
Thank you !! As suggested it created a result.txt. But the problem was that I changed the contents of the Orders.txt, Distance.txt and Vehicles.txt as per my requirement in the same format as provided. But the result.txt showed as Total Number of Route: 0 Total Cost: 0.000 Total Distance: 0.000 Total TravelTime: 0.000
Forward your orders.txt to gmail(mani.iiit123@gmail.com). I will check that and let you know.
It gave me this following output:
Total Number of Route: 3 Total Cost: 332.765 Total Distance: 332.765 Total TravelTime: 424.027 Route No. 1: Vehicle Id: 1 Starting Depot Id: 1 End Depot Id: 1 Visited Order Ids: 7, 5 Route No. 2: Vehicle Id: 2 Starting Depot Id: 1 End Depot Id: 1 Visited Order Ids: 8 Route No. 3: Vehicle Id: 3 Starting Depot Id: 1 End Depot Id: 1 Visited Order Ids:
Just replace Orders.txt Distance.txt Vehicles.txt with your files keeping the filenames same. Check the output above.
Thank you !!!
Testertest.cpp: In function ‘void dlog2(char)’: Tester_test.cpp:12:16: warning: format not a string literal and no format arguments [-Wformat-security] fprintf(fp,ptr); ^ Tester_test.cpp: In function ‘void loadOrders()’: Testertest.cpp:26:23: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] dlog2("REACHED ORDER"); ^ Tester_test.cpp: In function ‘void loadVehicles()’: Testertest.cpp:110:26: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] dlog2("REACHED VEHICLES"); ^ Tester_test.cpp: In function ‘void loadDistanceMatrix()’: Testertest.cpp:154:33: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] dlog2("REACHED DISTANCE MATRIX"); ^ Tester_test.cpp: In function ‘bool print_solution(std::string)’: Testertest.cpp:199:24: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] dlog2("REACHED RESULT"); ^ /tmp/cc8oiyrb.o: In function(CTourInfo )':
Tester_test.cpp:(.text._ZSt8DestroyI9CTourInfoEvPT[_ZSt8DestroyI9CTourInfoEvPT]+0xd): undefined reference to `CTourInfo::~CTourInfo()'
collect2: error: ld returned 1 exit status
loadOrders()': Tester_test.cpp:(.text+0x201): undefined reference to
CDepotInfo::CDepotInfo()' Tester_test.cpp:(.text+0x36b): undefined reference toCVRPSolver::addDepot(CDepotInfo)' Tester_test.cpp:(.text+0x376): undefined reference to
CDepotInfo::~CDepotInfo()' Tester_test.cpp:(.text+0x388): undefined reference toCDepotInfo::~CDepotInfo()' Tester_test.cpp:(.text+0x398): undefined reference to
COrderInfo::COrderInfo()' Tester_test.cpp:(.text+0x584): undefined reference toCVRPSolver::addOrder(COrderInfo)' Tester_test.cpp:(.text+0x58f): undefined reference to
COrderInfo::~COrderInfo()' Tester_test.cpp:(.text+0x59a): undefined reference toCOrderInfo::~COrderInfo()' Tester_test.cpp:(.text+0x653): undefined reference to
CDepotInfo::~CDepotInfo()' Tester_test.cpp:(.text+0x662): undefined reference toCDepotInfo::~CDepotInfo()' Tester_test.cpp:(.text+0x671): undefined reference to
COrderInfo::~COrderInfo()' Tester_test.cpp:(.text+0x680): undefined reference toCOrderInfo::~COrderInfo()' /tmp/cc8oiyrb.o: In function
loadVehicles()': Tester_test.cpp:(.text+0x83c): undefined reference toCVehicleInfo::CVehicleInfo()' Tester_test.cpp:(.text+0x8ee): undefined reference to
CVRPSolver::addVehicle(CVehicleInfo)' Tester_test.cpp:(.text+0x8f9): undefined reference toCVehicleInfo::~CVehicleInfo()' Tester_test.cpp:(.text+0x904): undefined reference to
CVehicleInfo::~CVehicleInfo()' Tester_test.cpp:(.text+0x9b1): undefined reference toCVehicleInfo::~CVehicleInfo()' Tester_test.cpp:(.text+0x9c0): undefined reference to
CVehicleInfo::~CVehicleInfo()' /tmp/cc8oiyrb.o: In functionloadDistanceMatrix()': Tester_test.cpp:(.text+0xc3e): undefined reference to
CVRPSolver::addDepotToOrderCost(int, int, CostPack)' Tester_test.cpp:(.text+0xc8d): undefined reference toCVRPSolver::addOrderToDepotCost(int, int, CostPack)' Tester_test.cpp:(.text+0xcd3): undefined reference to
CVRPSolver::addOrderToOrderCost(int, int, CostPack)' /tmp/cc8oiyrb.o: In functionprint_solution(std::string)': Tester_test.cpp:(.text+0xe06): undefined reference to
CSolutionInfo::CSolutionInfo()' Tester_test.cpp:(.text+0xe23): undefined reference toCVRPSolver::getSolution(CSolutionInfo&, std::string&)' Tester_test.cpp:(.text+0xe89): undefined reference to
CTourInfo::CTourInfo()' Tester_test.cpp:(.text+0x1138): undefined reference toCTourInfo::~CTourInfo()' Tester_test.cpp:(.text+0x1146): undefined reference to
CSolutionInfo::~CSolutionInfo()' Tester_test.cpp:(.text+0x1169): undefined reference toCTourInfo::~CTourInfo()' Tester_test.cpp:(.text+0x117b): undefined reference to
CSolutionInfo::~CSolutionInfo()' /tmp/cc8oiyrb.o: In functionmain': Tester_test.cpp:(.text+0x11c3): undefined reference to
CVRPSolver::solveVRP(std::string&)' /tmp/cc8oiyrb.o: In function__static_initialization_and_destruction_0(int, int)': Tester_test.cpp:(.text+0x12b2): undefined reference to
CVRPSolver::CVRPSolver()' Tester_test.cpp:(.text+0x12c9): undefined reference toCVRPSolver::~CVRPSolver()' /tmp/cc8oiyrb.o: In function
CTourInfo::CTourInfo(CTourInfo const&)': Tester_test.cpp:(.text.ZN9CTourInfoC2ERKS[ZN9CTourInfoC5ERKS]+0xbe): undefined reference toCVehicleInfo::~CVehicleInfo()' /tmp/cc8oiyrb.o: In function
void std::DestroyCan anyone suggest me how to compile it ??