simulated annealing CLI changeable
parent
2914c64fda
commit
582ee7a0d2
|
|
@ -15,6 +15,9 @@ def main():
|
|||
ap.add_argument("--max-keys-down", default=2, type=int)
|
||||
ap.add_argument("--startup", default=3, type=int)
|
||||
ap.add_argument("--controller-setup", default=False, action="store_true")
|
||||
ap.add_argument("--simulated-annealing-initial-health", default=50, type=int)
|
||||
ap.add_argument("--simulated-annealing-nothing-penalty", default=100, type=int)
|
||||
ap.add_argument("--simulated-annealing-decay-rate", default=5, type=int)
|
||||
ap.add_argument("--translation", default=json.dumps({
|
||||
"up": {"key": "w", "weight": 20},
|
||||
"down": {"key": "s", "weight": 1},
|
||||
|
|
@ -23,6 +26,10 @@ def main():
|
|||
}))
|
||||
args = ap.parse_args()
|
||||
|
||||
writer.LineChooserSimulatedAnnealing.initial_health = args.simulated_annealing_initial_health
|
||||
writer.LineChooserSimulatedAnnealing.nothing_penalty = args.simulated_annealing_nothing_penalty
|
||||
writer.LineChooserSimulatedAnnealing.decay_rate = args.simulated_annealing_decay_rate
|
||||
|
||||
w_translation = json.loads(args.translation) if args.translation else None
|
||||
|
||||
w = writer.Writer(writer.PyAutoGUIWriter(w_translation))
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class LineChooserLatestSticky(LineChooser):
|
|||
|
||||
class LineChooserSimulatedAnnealing(LineChooser):
|
||||
initial_health = 50
|
||||
nothing_penalty = 10
|
||||
nothing_penalty = 100
|
||||
decay_rate = 5
|
||||
|
||||
def _choose(self, latest, oldest):
|
||||
|
|
|
|||
Loading…
Reference in New Issue