Documents usages of temperature

This commit is contained in:
LSaldyt
2017-09-28 15:04:42 -06:00
parent 1b84b22e3f
commit cd3ad65ff8
11 changed files with 336 additions and 11 deletions

85
copycat.log Normal file
View File

@ -0,0 +1,85 @@
object chosen = k from target string
destination: j
chosen bond facet: letterCategory
Source: k, destination: j
source descriptor: K
destination descriptor: J
proposing predecessor bond
object chosen = k from target string
destination: j
chosen bond facet: letterCategory
Source: k, destination: j
source descriptor: K
destination descriptor: J
proposing predecessor bond
object chosen = i from target string
destination: j
chosen bond facet: letterCategory
Source: i, destination: j
source descriptor: I
destination descriptor: J
proposing successor bond
object chosen = predecessor bond between j and k from other string
bond strength = 48 for predecessor bond between j and k
succeeded: posting bond-builder
object chosen = c from initial string
destination: b
chosen bond facet: letterCategory
Source: c, destination: b
source descriptor: C
destination descriptor: B
proposing predecessor bond
object chosen = predecessor bond between b and c from other string
bond strength = 48 for predecessor bond between b and c
succeeded: posting bond-builder
Post top down: top-down-description-scout, with urgency: 5
posting bottom up codelets
object chosen = predecessor bond between b and c from other string
number of incompatibleBonds: 0
no incompatible bonds
no incompatible groups
building bond predecessor bond between b and c
object chosen = predecessor bond between j and k from other string
number of incompatibleBonds: 0
no incompatible bonds
no incompatible groups
building bond predecessor bond between j and k
object chosen = b from initial string
destination: c
chosen bond facet: letterCategory
Source: b, destination: c
source descriptor: B
destination descriptor: C
proposing successor bond
object chosen = k from target string
destination: j
chosen bond facet: letterCategory
Source: k, destination: j
source descriptor: K
destination descriptor: J
proposing predecessor bond
object chosen = b from initial string
destination: a
chosen bond facet: letterCategory
Source: b, destination: a
source descriptor: B
destination descriptor: A
proposing predecessor bond
Post top down: top-down-description-scout, with urgency: 5
posting bottom up codelets
object chosen = j from target string
destination: k
chosen bond facet: letterCategory
Source: j, destination: k
source descriptor: J
destination descriptor: K
proposing successor bond
object chosen = b from initial string
object chosen = k from target string
object chosen = c from initial string
destination: b
chosen bond facet: letterCategory
Source: c, destination: b
source descriptor: C
destination descriptor: B
proposing predecessor bond

View File

@ -72,6 +72,7 @@ def __structureVsStructure(structure1, weight1, structure2, weight2):
"""Return true if the first structure comes out stronger than the second.""" """Return true if the first structure comes out stronger than the second."""
ctx = structure1.ctx ctx = structure1.ctx
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
structure1.updateStrength() structure1.updateStrength()
structure2.updateStrength() structure2.updateStrength()
@ -111,6 +112,7 @@ def __fightIncompatibles(incompatibles, structure, name,
def __slippability(ctx, conceptMappings): def __slippability(ctx, conceptMappings):
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
for mapping in conceptMappings: for mapping in conceptMappings:
slippiness = mapping.slippability() / 100.0 slippiness = mapping.slippability() / 100.0
@ -124,6 +126,7 @@ def __slippability(ctx, conceptMappings):
@codelet('breaker') @codelet('breaker')
def breaker(ctx, codelet): def breaker(ctx, codelet):
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
workspace = ctx.workspace workspace = ctx.workspace
# TODO: use entropy # TODO: use entropy
@ -161,6 +164,7 @@ def chooseRelevantDescriptionByActivation(ctx, workspaceObject):
def similarPropertyLinks(ctx, slip_node): def similarPropertyLinks(ctx, slip_node):
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
result = [] result = []
for slip_link in slip_node.propertyLinks: for slip_link in slip_node.propertyLinks:
@ -216,6 +220,7 @@ def top_down_description_scout(ctx, codelet):
def description_strength_tester(ctx, codelet): def description_strength_tester(ctx, codelet):
coderack = ctx.coderack coderack = ctx.coderack
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
description = codelet.arguments[0] description = codelet.arguments[0]
description.descriptor.buffer = 100.0 description.descriptor.buffer = 100.0
@ -301,6 +306,7 @@ def rule_scout(ctx, codelet):
coderack = ctx.coderack coderack = ctx.coderack
random = ctx.random random = ctx.random
slipnet = ctx.slipnet slipnet = ctx.slipnet
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
workspace = ctx.workspace workspace = ctx.workspace
assert workspace.numberOfUnreplacedObjects() == 0 assert workspace.numberOfUnreplacedObjects() == 0
@ -339,6 +345,7 @@ def rule_scout(ctx, codelet):
# "union of this and distinguishing descriptors" # "union of this and distinguishing descriptors"
assert objectList assert objectList
# use conceptual depth to choose a description # use conceptual depth to choose a description
# TODO: use entropy
weights = [ weights = [
temperature.getAdjustedValue(node.conceptualDepth) temperature.getAdjustedValue(node.conceptualDepth)
for node in objectList for node in objectList
@ -350,6 +357,7 @@ def rule_scout(ctx, codelet):
objectList += [changed.replacement.relation] objectList += [changed.replacement.relation]
objectList += [changed.replacement.objectFromModified.getDescriptor( objectList += [changed.replacement.objectFromModified.getDescriptor(
slipnet.letterCategory)] slipnet.letterCategory)]
# TODO: use entropy
# use conceptual depth to choose a relation # use conceptual depth to choose a relation
weights = [ weights = [
temperature.getAdjustedValue(node.conceptualDepth) temperature.getAdjustedValue(node.conceptualDepth)
@ -364,6 +372,7 @@ def rule_scout(ctx, codelet):
def rule_strength_tester(ctx, codelet): def rule_strength_tester(ctx, codelet):
coderack = ctx.coderack coderack = ctx.coderack
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
rule = codelet.arguments[0] rule = codelet.arguments[0]
rule.updateStrength() rule.updateStrength()
@ -465,6 +474,7 @@ def top_down_bond_scout__direction(ctx, codelet):
def bond_strength_tester(ctx, codelet): def bond_strength_tester(ctx, codelet):
coderack = ctx.coderack coderack = ctx.coderack
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
bond = codelet.arguments[0] bond = codelet.arguments[0]
__showWhichStringObjectIsFrom(bond) __showWhichStringObjectIsFrom(bond)
@ -747,6 +757,7 @@ def group_strength_tester(ctx, codelet):
coderack = ctx.coderack coderack = ctx.coderack
random = ctx.random random = ctx.random
slipnet = ctx.slipnet slipnet = ctx.slipnet
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
# update strength value of the group # update strength value of the group
group = codelet.arguments[0] group = codelet.arguments[0]
@ -869,6 +880,7 @@ def __getCutoffWeights(bondDensity):
def rule_translator(ctx, codelet): def rule_translator(ctx, codelet):
coderack = ctx.coderack coderack = ctx.coderack
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
workspace = ctx.workspace workspace = ctx.workspace
assert workspace.rule assert workspace.rule
@ -946,6 +958,7 @@ def important_object_correspondence_scout(ctx, codelet):
assert objectFromInitial is not None assert objectFromInitial is not None
descriptors = objectFromInitial.relevantDistinguishingDescriptors() descriptors = objectFromInitial.relevantDistinguishingDescriptors()
# choose descriptor by conceptual depth # choose descriptor by conceptual depth
# TODO: use entropy
weights = [temperature.getAdjustedValue(n.conceptualDepth) for n in descriptors] weights = [temperature.getAdjustedValue(n.conceptualDepth) for n in descriptors]
slipnode = random.weighted_choice(descriptors, weights) slipnode = random.weighted_choice(descriptors, weights)
assert slipnode assert slipnode
@ -997,6 +1010,7 @@ def important_object_correspondence_scout(ctx, codelet):
def correspondence_strength_tester(ctx, codelet): def correspondence_strength_tester(ctx, codelet):
coderack = ctx.coderack coderack = ctx.coderack
random = ctx.random random = ctx.random
# TODO: use entropy
temperature = ctx.temperature temperature = ctx.temperature
workspace = ctx.workspace workspace = ctx.workspace
correspondence = codelet.arguments[0] correspondence = codelet.arguments[0]

View File

@ -68,6 +68,7 @@ class Coderack(object):
self.postBottomUpCodelets() self.postBottomUpCodelets()
def probabilityOfPosting(self, codeletName): def probabilityOfPosting(self, codeletName):
# TODO: use entropy
temperature = self.ctx.temperature temperature = self.ctx.temperature
workspace = self.ctx.workspace workspace = self.ctx.workspace
if codeletName == 'breaker': if codeletName == 'breaker':
@ -156,6 +157,7 @@ class Coderack(object):
def __postBottomUpCodelets(self, codeletName): def __postBottomUpCodelets(self, codeletName):
random = self.ctx.random random = self.ctx.random
# TODO: use entropy
temperature = self.ctx.temperature temperature = self.ctx.temperature
probability = self.probabilityOfPosting(codeletName) probability = self.probabilityOfPosting(codeletName)
howMany = self.howManyToPost(codeletName) howMany = self.howManyToPost(codeletName)
@ -288,6 +290,7 @@ class Coderack(object):
def chooseCodeletToRun(self): def chooseCodeletToRun(self):
random = self.ctx.random random = self.ctx.random
# TODO: use entropy
temperature = self.ctx.temperature temperature = self.ctx.temperature
assert self.codelets assert self.codelets

View File

@ -16,7 +16,7 @@ class Reporter(object):
def report_slipnet(self, slipnet): def report_slipnet(self, slipnet):
pass pass
def report_temperature(self, temperature): def report_temperature(self, temperature): #TODO: use entropy
pass pass
def report_workspace(self, workspace): def report_workspace(self, workspace):
@ -28,19 +28,19 @@ class Copycat(object):
self.coderack = Coderack(self) self.coderack = Coderack(self)
self.random = Randomness(rng_seed) self.random = Randomness(rng_seed)
self.slipnet = Slipnet() self.slipnet = Slipnet()
self.temperature = Temperature() self.temperature = Temperature() # TODO: use entropy
self.workspace = Workspace(self) self.workspace = Workspace(self)
self.reporter = reporter or Reporter() self.reporter = reporter or Reporter()
def mainLoop(self, lastUpdate): def mainLoop(self, lastUpdate):
currentTime = self.coderack.codeletsRun currentTime = self.coderack.codeletsRun
self.temperature.tryUnclamp(currentTime) self.temperature.tryUnclamp(currentTime) # TODO: use entropy
# Every 15 codelets, we update the workspace. # Every 15 codelets, we update the workspace.
if currentTime >= lastUpdate + 15: if currentTime >= lastUpdate + 15:
self.workspace.updateEverything() self.workspace.updateEverything()
self.coderack.updateCodelets() self.coderack.updateCodelets()
self.slipnet.update(self.random) self.slipnet.update(self.random)
self.temperature.update(self.workspace.getUpdatedTemperature()) self.temperature.update(self.workspace.getUpdatedTemperature()) # TODO: use entropy
lastUpdate = currentTime lastUpdate = currentTime
self.reporter.report_slipnet(self.slipnet) self.reporter.report_slipnet(self.slipnet)
self.coderack.chooseAndRunCodelet() self.coderack.chooseAndRunCodelet()
@ -53,14 +53,14 @@ class Copycat(object):
"""Run a trial of the copycat algorithm""" """Run a trial of the copycat algorithm"""
self.coderack.reset() self.coderack.reset()
self.slipnet.reset() self.slipnet.reset()
self.temperature.reset() self.temperature.reset() # TODO: use entropy
self.workspace.reset() self.workspace.reset()
lastUpdate = float('-inf') lastUpdate = float('-inf')
while self.workspace.finalAnswer is None: while self.workspace.finalAnswer is None:
lastUpdate = self.mainLoop(lastUpdate) lastUpdate = self.mainLoop(lastUpdate)
answer = { answer = {
'answer': self.workspace.finalAnswer, 'answer': self.workspace.finalAnswer,
'temp': self.temperature.last_unclamped_value, 'temp': self.temperature.last_unclamped_value, # TODO: use entropy
'time': self.coderack.codeletsRun, 'time': self.coderack.codeletsRun,
} }
self.reporter.report_answer(answer) self.reporter.report_answer(answer)
@ -73,11 +73,11 @@ class Copycat(object):
answer = self.runTrial() answer = self.runTrial()
d = answers.setdefault(answer['answer'], { d = answers.setdefault(answer['answer'], {
'count': 0, 'count': 0,
'sumtemp': 0, 'sumtemp': 0, # TODO: use entropy
'sumtime': 0 'sumtime': 0
}) })
d['count'] += 1 d['count'] += 1
d['sumtemp'] += answer['temp'] d['sumtemp'] += answer['temp'] # TODO: use entropy
d['sumtime'] += answer['time'] d['sumtime'] += answer['time']
for answer, d in answers.items(): for answer, d in answers.items():

View File

@ -63,7 +63,7 @@ class CursesReporter(Reporter):
coderackHeight = height - upperHeight - answersHeight coderackHeight = height - upperHeight - answersHeight
self.focusOnSlipnet = focus_on_slipnet self.focusOnSlipnet = focus_on_slipnet
self.fpsGoal = fps_goal self.fpsGoal = fps_goal
self.temperatureWindow = SafeSubwindow(window, height, 5, 0, 0) self.temperatureWindow = SafeSubwindow(window, height, 5, 0, 0) # TODO: use entropy (entropyWindow)
self.upperWindow = SafeSubwindow(window, upperHeight, width-5, 0, 5) self.upperWindow = SafeSubwindow(window, upperHeight, width-5, 0, 5)
self.coderackWindow = SafeSubwindow(window, coderackHeight, width-5, upperHeight, 5) self.coderackWindow = SafeSubwindow(window, coderackHeight, width-5, upperHeight, 5)
self.answersWindow = SafeSubwindow(window, answersHeight, width-5, upperHeight + coderackHeight, 5) self.answersWindow = SafeSubwindow(window, answersHeight, width-5, upperHeight + coderackHeight, 5)

View File

@ -1,6 +1,5 @@
import math import math
class Temperature(object): class Temperature(object):
def __init__(self): def __init__(self):
self.reset() self.reset()
@ -47,6 +46,8 @@ class Temperature(object):
""" """
def getAdjustedProbability(self, value): def getAdjustedProbability(self, value):
# TODO: use entropy
""" """
This function returns the probability for a decision. This function returns the probability for a decision.
Copied above. Copied above.

View File

@ -2,6 +2,7 @@ import unittest
from .copycat import Copycat from .copycat import Copycat
# TODO: update test cases to use entropy
def pnormaldist(p): def pnormaldist(p):
table = { table = {

View File

@ -1,5 +1,6 @@
def __chooseObjectFromList(ctx, objects, attribute): def __chooseObjectFromList(ctx, objects, attribute):
# TODO: use entropy
random = ctx.random random = ctx.random
temperature = ctx.temperature temperature = ctx.temperature
weights = [ weights = [

View File

@ -2,7 +2,6 @@ from .description import Description
from .formulas import weightedAverage from .formulas import weightedAverage
from .workspaceStructure import WorkspaceStructure from .workspaceStructure import WorkspaceStructure
class WorkspaceObject(WorkspaceStructure): class WorkspaceObject(WorkspaceStructure):
# pylint: disable=too-many-instance-attributes # pylint: disable=too-many-instance-attributes
def __init__(self, workspaceString): def __init__(self, workspaceString):

168
temp_usages.txt Normal file
View File

@ -0,0 +1,168 @@
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: weightedStrength1 = temperature.getAdjustedValue(
copycat/codeletMethods.py: weightedStrength2 = temperature.getAdjustedValue(
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: probabilityOfSlippage = temperature.getAdjustedProbability(slippiness)
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: probabilityOfFizzle = (100.0 - temperature.value()) / 100.0
copycat/codeletMethods.py: breakProbability = temperature.getAdjustedProbability(
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: probability = temperature.getAdjustedProbability(association)
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: probability = temperature.getAdjustedProbability(strength / 100.0)
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: temperature.getAdjustedValue(node.conceptualDepth)
copycat/codeletMethods.py: temperature.getAdjustedValue(node.conceptualDepth)
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: probability = temperature.getAdjustedProbability(rule.totalStrength / 100.0)
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: probability = temperature.getAdjustedProbability(strength / 100.0)
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: probability = temperature.getAdjustedProbability(strength / 100.0)
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: if cutoff >= temperature.actual_value:
copycat/codeletMethods.py: temperature.clampUntil(coderack.codeletsRun + 100)
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: weights = [temperature.getAdjustedValue(n.conceptualDepth) for n in descriptors]
copycat/codeletMethods.py: temperature = ctx.temperature
copycat/codeletMethods.py: probability = temperature.getAdjustedProbability(strength / 100.0)
copycat/coderack.py: temperature = self.ctx.temperature
copycat/coderack.py: return (temperature.value() / 100.0) ** 2
copycat/coderack.py: temperature = self.ctx.temperature
copycat/coderack.py: if temperature.value() < 25.0 and 'translator' in codeletName:
copycat/coderack.py: temperature = self.ctx.temperature
copycat/coderack.py: scale = (100.0 - temperature.value() + 10.0) / 15.0
copycat/copycat.py:from .temperature import Temperature
copycat/copycat.py: def report_temperature(self, temperature):
copycat/copycat.py: self.temperature = Temperature()
copycat/copycat.py: self.temperature.tryUnclamp(currentTime)
copycat/copycat.py: self.temperature.update(self.workspace.getUpdatedTemperature())
copycat/copycat.py: self.reporter.report_temperature(self.temperature)
copycat/copycat.py: self.temperature.reset()
copycat/copycat.py: 'temp': self.temperature.last_unclamped_value,
copycat/copycat.py: 'sumtemp': 0,
copycat/copycat.py: d['sumtemp'] += answer['temp']
copycat/copycat.py: d['avgtemp'] = d.pop('sumtemp') / d['count']
copycat/curses_reporter.py: self.temperatureWindow = SafeSubwindow(window, height, 5, 0, 0)
copycat/curses_reporter.py: for w in [self.temperatureWindow, self.upperWindow, self.answersWindow, self.fpsWindow]:
copycat/curses_reporter.py: w = self.temperatureWindow # just a random window
copycat/curses_reporter.py: 'sumtemp': 0,
copycat/curses_reporter.py: d['sumtemp'] += answer['temp']
copycat/curses_reporter.py: d['avgtemp'] = d['sumtemp'] / d['count']
copycat/curses_reporter.py: return 3 * d['count'] - d['avgtemp']
copycat/curses_reporter.py: return '%s: %d (avg time %.1f, avg temp %.1f)' % (
copycat/curses_reporter.py: d['answer'], d['count'], d['avgtime'], d['avgtemp'],
copycat/curses_reporter.py: def report_temperature(self, temperature):
copycat/curses_reporter.py: w = self.temperatureWindow
copycat/curses_reporter.py: mercury = max_mercury * temperature.value() / 100.0
copycat/curses_reporter.py: w.addnstr(height - 2, 1, '%3d' % temperature.actual_value, 3)
copycat/group.py: temperature = self.ctx.temperature
copycat/group.py: return temperature.getAdjustedProbability(supportedActivation)
copycat/group.py: temperature = self.ctx.temperature
copycat/group.py: value = temperature.getAdjustedProbability(probability)
copycat/temperature.py: iiijjjlll: 670 (avg time 1108.5, avg temp 23.6)
copycat/temperature.py: iiijjjd: 2 (avg time 1156.0, avg temp 35.0)
copycat/temperature.py: iiijjjkkl: 315 (avg time 1194.4, avg temp 35.5)
copycat/temperature.py: iiijjjkll: 8 (avg time 2096.8, avg temp 44.1)
copycat/temperature.py: iiijjjkkd: 5 (avg time 837.2, avg temp 48.0)
copycat/temperature.py: wyz: 5 (avg time 2275.2, avg temp 14.9)
copycat/temperature.py: xyd: 982 (avg time 2794.4, avg temp 17.5)
copycat/temperature.py: yyz: 7 (avg time 2731.9, avg temp 25.1)
copycat/temperature.py: dyz: 2 (avg time 3320.0, avg temp 27.1)
copycat/temperature.py: xyy: 2 (avg time 4084.5, avg temp 31.1)
copycat/temperature.py: xyz: 2 (avg time 1873.5, avg temp 52.1)
copycat/temperature.py: wyz: 7 (avg time 3192.9, avg temp 13.1)
copycat/temperature.py: xyd: 985 (avg time 2849.1, avg temp 17.5)
copycat/temperature.py: yyz: 6 (avg time 3836.7, avg temp 18.6)
copycat/temperature.py: xyy: 1 (avg time 1421.0, avg temp 19.5)
copycat/temperature.py: xyz: 1 (avg time 7350.0, avg temp 48.3)
copycat/temperature.py: wyz: 8 (avg time 4140.5, avg temp 13.3)
copycat/temperature.py: yyz: 6 (avg time 2905.2, avg temp 14.5)
copycat/temperature.py: xyd: 982 (avg time 3025.4, avg temp 17.6)
copycat/temperature.py: dyz: 4 (avg time 4265.0, avg temp 17.7)
copycat/temperature.py: dyz: 1 (avg time 5198.0, avg temp 15.3)
copycat/temperature.py: wyz: 3 (avg time 4043.7, avg temp 17.1)
copycat/temperature.py: yyz: 9 (avg time 3373.6, avg temp 21.0)
copycat/temperature.py: xyd: 84 (avg time 5011.1, avg temp 23.3)
copycat/temperature.py: xyy: 3 (avg time 4752.0, avg temp 27.9)
copycat/temperature.py: xyd: 1000 (avg time 1625.2, avg temp 17.3)
copycat/temperature.py: xyz: 3 (avg time 3996.7, avg temp 81.1)
copycat/temperature.py: dyz: 46 (avg time 5931.7, avg temp 82.6)
copycat/temperature.py: xd: 17 (avg time 6090.3, avg temp 83.8)
copycat/temperature.py: xyd: 934 (avg time 7699.8, avg temp 88.1)
copycat/temperature.py: wyz: 123 (avg time 5933.1, avg temp 16.5)
copycat/temperature.py: xyy: 200 (avg time 6486.7, avg temp 27.8)
copycat/temperature.py: yyz: 330 (avg time 6310.2, avg temp 38.5)
copycat/temperature.py: dyz: 75 (avg time 6393.3, avg temp 39.6)
copycat/temperature.py: yzz: 5 (avg time 4965.0, avg temp 59.3)
copycat/temperature.py: xyz: 160 (avg time 6886.2, avg temp 60.2)
copycat/temperature.py: xd: 4 (avg time 2841.0, avg temp 61.8)
copycat/temperature.py: dz: 3 (avg time 3721.0, avg temp 62.1)
copycat/temperature.py: xyd: 100 (avg time 5853.1, avg temp 67.5)
copycat/temperature.py: wyz: 78 (avg time 7793.7, avg temp 16.6)
copycat/temperature.py: xyy: 202 (avg time 9168.5, avg temp 27.5)
copycat/temperature.py: wxz: 1 (avg time 3154.0, avg temp 33.4)
copycat/temperature.py: dyz: 63 (avg time 7950.3, avg temp 41.7)
copycat/temperature.py: yyz: 217 (avg time 8147.4, avg temp 41.7)
copycat/temperature.py: xyz: 201 (avg time 7579.7, avg temp 62.5)
copycat/temperature.py: xxy: 1 (avg time 7994.0, avg temp 64.8)
copycat/temperature.py: yzz: 8 (avg time 4672.6, avg temp 65.7)
copycat/temperature.py: xd: 9 (avg time 9215.2, avg temp 68.1)
copycat/temperature.py: xyd: 217 (avg time 7677.9, avg temp 73.8)
copycat/temperature.py: dz: 3 (avg time 20379.0, avg temp 77.3)
copycat/temperature.py: xyd: 100 (avg time 2984.3, avg temp 18.2)
copycat/temperature.py: jijjkk: 66 (avg time 3200.1, avg temp 61.3)
copycat/temperature.py: iijjkk: 114 (avg time 5017.2, avg temp 63.5)
copycat/temperature.py: dijjkk: 23 (avg time 2209.0, avg temp 67.3)
copycat/temperature.py: iijjkl: 748 (avg time 3262.8, avg temp 70.0)
copycat/temperature.py: iijjkd: 49 (avg time 2315.9, avg temp 76.3)
copycat/temperature.py: iijjll: 59 (avg time 797.4, avg temp 19.8)
copycat/temperature.py: iijjkl: 41 (avg time 696.1, avg temp 28.5)
copycat/temperature.py: mrrlll: 77 (avg time 2195.7, avg temp 41.4)
copycat/temperature.py: mrrd: 2 (avg time 1698.0, avg temp 42.6)
copycat/temperature.py: mrrkkl: 20 (avg time 1317.8, avg temp 46.6)
copycat/temperature.py: mrrkkd: 1 (avg time 1835.0, avg temp 48.6)
copycat/temperature.py: nrrkkk: 11 (avg time 3637.8, avg temp 64.6)
copycat/temperature.py: drrkkk: 3 (avg time 5921.3, avg temp 66.2)
copycat/temperature.py: mrrkkd: 7 (avg time 6771.3, avg temp 74.6)
copycat/temperature.py: mrrkkl: 79 (avg time 3723.0, avg temp 74.9)
copycat/tests.py:def lower_bound_on_probability(hits, attempts, confidence=0.95):
copycat/tests.py: if attempts == 0:
copycat/tests.py: phat = 1.0 * hits / attempts
copycat/tests.py: under_sqrt = (phat * (1 - phat) + zsqr / (4 * attempts)) / attempts
copycat/tests.py: denominator = (1 + zsqr / attempts)
copycat/tests.py: return (phat + zsqr / (2 * attempts) - z * (under_sqrt ** 0.5)) / denominator
copycat/tests.py:def upper_bound_on_probability(hits, attempts, confidence=0.95):
copycat/tests.py: misses = attempts - hits
copycat/tests.py: return 1.0 - lower_bound_on_probability(misses, attempts, confidence)
copycat/tests.py: if abs(actual[k]['avgtemp'] - expected[k]['avgtemp']) >= 10.0 + (10.0 / actual[k]['count']):
copycat/tests.py: print('Failed (%s - %s >= %s)' % (actual[k]['avgtemp'], expected[k]['avgtemp'], 10.0 + (10.0 / actual[k]['count'])))
copycat/tests.py: 'efd': {'count': 1, 'avgtemp': 16},
copycat/tests.py: 'efh': {'count': 99, 'avgtemp': 19},
copycat/tests.py: 'ijd': {'count': 4, 'avgtemp': 24},
copycat/tests.py: 'ijl': {'count': 96, 'avgtemp': 20},
copycat/tests.py: 'xyd': {'count': 100, 'avgtemp': 19},
copycat/tests.py: 'ijkkk': {'count': 7, 'avgtemp': 21},
copycat/tests.py: 'ijll': {'count': 47, 'avgtemp': 28},
copycat/tests.py: 'ijkl': {'count': 44, 'avgtemp': 32},
copycat/tests.py: 'ijkd': {'count': 2, 'avgtemp': 65},
copycat/tests.py: 'mrrjjjj': {'count': 4, 'avgtemp': 16},
copycat/tests.py: 'mrrkkk': {'count': 31, 'avgtemp': 47},
copycat/tests.py: 'mrrjjk': {'count': 64, 'avgtemp': 51},
copycat/tests.py: 'mrrjkk': {'count': 1, 'avgtemp': 52},
copycat/tests.py: 'mrrjjd': {'count': 1, 'avgtemp': 54},
copycat/tests.py: 'milj': {'count': 85, 'avgtemp': 55},
copycat/tests.py: 'mikj': {'count': 10, 'avgtemp': 56},
copycat/tests.py: 'milk': {'count': 1, 'avgtemp': 56},
copycat/tests.py: 'lilk': {'count': 1, 'avgtemp': 57},
copycat/tests.py: 'milb': {'count': 3, 'avgtemp': 57},
copycat/tests.py: 'xc': {'count': 9, 'avgtemp': 57},
copycat/tests.py: 'xyc': {'count': 82, 'avgtemp': 59},
copycat/tests.py: 'cyx': {'count': 7, 'avgtemp': 68},
copycat/tests.py: 'xyx': {'count': 2, 'avgtemp': 69},
copycat/tests.py: 'cakg': {'count': 99, 'avgtemp': 70},
copycat/tests.py: 'gake': {'count': 1, 'avgtemp': 59},
copycat/tests.py: 'kitteg': {'count': 96, 'avgtemp': 66},
copycat/tests.py: 'kitten': {'count': 4, 'avgtemp': 68},
copycat/workspaceFormulas.py: temperature = ctx.temperature
copycat/workspaceFormulas.py: temperature.getAdjustedValue(

53
todos.txt Normal file
View File

@ -0,0 +1,53 @@
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO:use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/codeletMethods.py: # TODO: use entropy
copycat/coderack.py: # TODO: use entropy
copycat/coderack.py: # TODO: use entropy
copycat/coderack.py: # TODO: use entropy
copycat/coderack.py: # TODO: use entropy
copycat/coderack.py: # TODO: use entropy
copycat/coderack.py: # TODO: use entropy
copycat/copycat.py: def report_temperature(self, temperature): #TODO: use entropy
copycat/copycat.py: self.temperature = Temperature() # TODO: use entropy
copycat/copycat.py: self.temperature.tryUnclamp(currentTime) # TODO: use entropy
copycat/copycat.py: self.temperature.update(self.workspace.getUpdatedTemperature()) # TODO: use entropy
copycat/copycat.py: self.temperature.reset() # TODO: use entropy
copycat/copycat.py: 'temp': self.temperature.last_unclamped_value, # TODO: use entropy
copycat/copycat.py: 'sumtemp': 0, # TODO: use entropy
copycat/copycat.py: d['sumtemp'] += answer['temp'] # TODO: use entropy
copycat/curses_reporter.py: self.temperatureWindow = SafeSubwindow(window, height, 5, 0, 0) # TODO: use entropy (entropyWindow)
copycat/curses_reporter.py: #TODO: use entropy
copycat/group.py: #TODO: use entropy
copycat/group.py: #TODO: use entropy
copycat/temperature.py: # TODO: use entropy
copycat/tests.py:# TODO: update test cases to use entropy
copycat/workspaceFormulas.py: # TODO: use entropy
copycat/workspaceObject.py: from .group import Group # gross, TODO FIXME
copycat/workspace.py: # TODO: Initial part of refactoring in this method
copycat/workspace.py: # TODO: Extract method?
copycat/workspace.py: # TODO: these 3 methods seem to be the same... are they? If so, Extract method.
copycat/workspace.py: # TODO: use entropy