test_modules.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 from __future__ import print_function
3 import os
4 import unittest
5 import resource_retriever
6 # Tested module
7 import lkh_solver as lkh
8 
9 
10 class Test_glkh_solver(unittest.TestCase):
11  def test_glkh_solver(self):
12  folder = 'package://glkh_solver/gtsplib'
13  path = resource_retriever.get_filename(folder, use_protocol=False)
14  files = []
15  for name in os.listdir(path):
16  fullpath = os.path.join(path, name)
17  if os.path.isfile(fullpath) and fullpath.endswith('.gtsp'):
18  files.append(fullpath)
19  # Solve them
20  pkg = 'glkh_solver'
21  rosnode = 'glkh_solver'
22  params = lkh.solver.SolverParameters()
23  params.trace_level = 0
24  for problem_file in files:
25  tour, info = lkh.solver.lkh_solver(problem_file, params, pkg, rosnode)
def get_filename(url, use_protocol=True)


glkh_solver
Author(s): Francisco Suarez-Ruiz
autogenerated on Mon Jun 10 2019 13:50:27