From 6b02fe3ca0824eb62e4f1acd145ddc3d7bb2ea31 Mon Sep 17 00:00:00 2001 From: LSaldyt Date: Thu, 2 Nov 2017 16:19:01 -0700 Subject: [PATCH] WIP --- copycat/copycat.py | 2 +- copycat/temperature.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/copycat/copycat.py b/copycat/copycat.py index 81139f5..2d41050 100644 --- a/copycat/copycat.py +++ b/copycat/copycat.py @@ -71,7 +71,7 @@ class Copycat(object): self.workspace.resetWithStrings(initial, modified, target) answers = {} - for formula in ['original', 'best', 'sbest', 'pbest']: + for formula in ['original', 'best', 'sbest', 'pbest', 'none']: self.temperature.useAdj(formula) answers = {} for i in range(iterations): diff --git a/copycat/temperature.py b/copycat/temperature.py index 7d444d9..ce78d96 100644 --- a/copycat/temperature.py +++ b/copycat/temperature.py @@ -80,6 +80,8 @@ def _parameterized_best(temp, prob): u = prob ** r if prob < .5 else prob ** (1/r) return _weighted(temp, prob, s, u) +def _none(temp, prob): + return prob class Temperature(object): def __init__(self): @@ -96,7 +98,8 @@ class Temperature(object): 'average_alt' : _averaged_alt, 'best' : _working_best, 'sbest' : _soft_best, - 'pbest' : _parameterized_best} + 'pbest' : _parameterized_best, + 'none' : _none} self.diffs = 0 self.ndiffs = 0