diff options
| author | JonZhao <[email protected]> | 2019-05-30 12:57:27 +0800 |
|---|---|---|
| committer | JonZhao <[email protected]> | 2019-05-30 12:57:27 +0800 |
| commit | 2eacd762b1605f4b6d449b8725d980c96de4d826 (patch) | |
| tree | 992d1b462433fc44f7e550c0d2a7e60b7afa35df /vrptw_base.py | |
| parent | b42de46036f88989a41935ef7f67538d23415e18 (diff) | |
| download | VRPTW-ACO-python-2eacd762b1605f4b6d449b8725d980c96de4d826.tar.gz VRPTW-ACO-python-2eacd762b1605f4b6d449b8725d980c96de4d826.tar.bz2 VRPTW-ACO-python-2eacd762b1605f4b6d449b8725d980c96de4d826.zip | |
add local_search_procedure_for_global_path
Diffstat (limited to 'vrptw_base.py')
| -rw-r--r-- | vrptw_base.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vrptw_base.py b/vrptw_base.py index 988713e..52cdafa 100644 --- a/vrptw_base.py +++ b/vrptw_base.py @@ -166,9 +166,14 @@ class VrptwGraph: class PathMessage: def __init__(self, path, distance): - self.path = copy.deepcopy(path) - self.distance = copy.deepcopy(distance) - self.used_vehicle_num = self.path.count(0) - 1 + if path is not None: + self.path = copy.deepcopy(path) + self.distance = copy.deepcopy(distance) + self.used_vehicle_num = self.path.count(0) - 1 + else: + self.path = None + self.distance = None + self.used_vehicle_num = None def get_path_info(self): return self.path, self.distance, self.used_vehicle_num |
