Skip to content

Commit 51efe35

Browse files
committed
Make iterated local search use the switch library.
1 parent 7d6f8bd commit 51efe35

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

python/stochastic/iterated_local_search.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#! usr/bin/env python3
22

33
from .common import path_cost, random_permutation
4+
from ..switch import decide
45

56
import math
67
import random
7-
import sys
88

99
"""
1010
2.5
@@ -120,10 +120,7 @@ def search(cities, max_iterations, max_no_improv, output_format="human"):
120120
# Algorithm configuration
121121
max_iterations = 100
122122
max_no_improv = 50
123-
output_format = "human"
124-
125-
if len(sys.argv) >= 2:
126-
output_format = sys.argv[1]
123+
output_format = decide()
127124

128125
# Execute the algorithm
129126
best = search(berlin52, max_iterations, max_no_improv, output_format)

0 commit comments

Comments
 (0)