Traceback (most recent call last):
File "examples/python/pdvrp.py", line 101, in <module>
app.run()
File "/usr/local/lib/python2.7/dist-packages/google/apputils/app.py", line 238, in run
return _actual_start()
File "/usr/local/lib/python2.7/dist-packages/google/apputils/app.py", line 267, in _actual_start
really_start()
File "/usr/local/lib/python2.7/dist-packages/google/apputils/app.py", line 220, in really_start
sys.exit(main(argv))
File "examples/python/pdvrp.py", line 77, in main
solver.AddConstraint(solver.MakeEquality(routing.VehicleVar(routing.NodeToIndex(7)),routing.VehicleVar(routing.NodeToIndex(8))))
File "/usr/local/lib/python2.7/dist-packages/ortools-3.3629-py2.7-linux-x86_64.egg/ortools/constraint_solver/pywrapcp.py", line 242, in <lambda>
__getattr__ = lambda self, name: _swig_getattr(self, Solver, name)
File "/usr/local/lib/python2.7/dist-packages/ortools-3.3629-py2.7-linux-x86_64.egg/ortools/constraint_solver/pywrapcp.py", line 74, in _swig_getattr
return _swig_getattr_nondynamic(self, class_type, name, 0)
File "/usr/local/lib/python2.7/dist-packages/ortools-3.3629-py2.7-linux-x86_64.egg/ortools/constraint_solver/pywrapcp.py", line 69, in _swig_getattr_nondynamic
return object.__getattr__(self, name)
AttributeError: type object 'object' has no attribute '__getattr__'
Here is my code:
routing = pywrapcp.RoutingModel(tsp_size, 1)
routing.SetDepot(10);
search_parameters = pywrapcp.RoutingModel.DefaultSearchParameters()
# Setting first solution heuristic: the
# method for finding a first solution to the problem.
search_parameters.first_solution_strategy = (
routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC)
# Create the distance callback, which takes two arguments (the from and to node indices)
# and returns the distance between these nodes.
dist_between_nodes = CreateDistanceCallback()
dist_callback = dist_between_nodes.Distance
routing.SetArcCostEvaluatorOfAllVehicles(dist_callback)
solver = routing.solver()
solver.AddConstraint(solver.MakeEquality(routing.VehicleVar(routing.NodeToIndex(7)),routing.VehicleVar(routing.NodeToIndex(8))))
routing.AddPickupAndDelivery(7,8)
As I am a python newbie, so I dont know what the error is. Please help. Thanks
easy_install --user -U ortools
--You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--