diff options
| author | JonZhao <[email protected]> | 2019-05-27 20:24:59 +0800 |
|---|---|---|
| committer | JonZhao <[email protected]> | 2019-05-27 20:24:59 +0800 |
| commit | 0e6ebb04fc63498bac25adef14826e305ee1f634 (patch) | |
| tree | cf97d6a861d0e14f2a5dcbc6b47c4e5a8c495da0 /vrptw_base.py | |
| parent | 8ce2cb66ae5f5e5ba5afc10edbf8f1e85967f090 (diff) | |
| download | VRPTW-ACO-python-0e6ebb04fc63498bac25adef14826e305ee1f634.tar.gz VRPTW-ACO-python-0e6ebb04fc63498bac25adef14826e305ee1f634.tar.bz2 VRPTW-ACO-python-0e6ebb04fc63498bac25adef14826e305ee1f634.zip | |
使用event来作为线程终止信号
Diffstat (limited to 'vrptw_base.py')
| -rw-r--r-- | vrptw_base.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/vrptw_base.py b/vrptw_base.py index 5837e10..4c2e7e1 100644 --- a/vrptw_base.py +++ b/vrptw_base.py @@ -178,17 +178,10 @@ class VrptwGraph: return nearest_ind -class VrptwMessage: - def __init__(self, info_type, path, distance): - super() - if info_type != 'stop' and info_type != 'path_info': - raise RuntimeError('info_type should be: stop or path_info') - self.info_type = info_type - self.path = copy.deepcopy(path) +class PathMessage: + def __init__(self, path, distance): + self.path = path self.distance = distance def get_path_info(self): return self.path, self.distance - - def is_to_stop(self): - return self.info_type == 'stop' |
