Preparing for refactor
This commit is contained in:
233203
copycat.log
233203
copycat.log
File diff suppressed because it is too large
Load Diff
@ -155,8 +155,7 @@ def breaker(ctx, codelet):
|
||||
def chooseRelevantDescriptionByActivation(ctx, workspaceObject):
|
||||
random = ctx.random
|
||||
descriptions = workspaceObject.relevantDescriptions()
|
||||
weights = [description.descriptor.activation
|
||||
for description in descriptions]
|
||||
weights = [description.descriptor.activation for description in descriptions]
|
||||
return random.weighted_choice(descriptions, weights)
|
||||
|
||||
|
||||
@ -401,8 +400,8 @@ def replacement_finder(ctx, codelet):
|
||||
relation = relations[diff]
|
||||
else:
|
||||
relation = None
|
||||
letterOfInitialString.replacement = Replacement(ctx,
|
||||
letterOfInitialString, letterOfModifiedString, relation)
|
||||
letterOfInitialString.replacement = Replacement(ctx, letterOfInitialString,
|
||||
letterOfModifiedString, relation)
|
||||
if relation != slipnet.sameness:
|
||||
letterOfInitialString.changed = True
|
||||
workspace.changedObject = letterOfInitialString
|
||||
@ -445,8 +444,8 @@ def top_down_bond_scout__direction(ctx, codelet):
|
||||
coderack = ctx.coderack
|
||||
slipnet = ctx.slipnet
|
||||
direction = codelet.arguments[0]
|
||||
source = __getScoutSource(ctx,
|
||||
direction, formulas.localDirectionCategoryRelevance, 'bond')
|
||||
source = __getScoutSource(ctx, direction, formulas.localDirectionCategoryRelevance,
|
||||
'bond')
|
||||
destination = chooseDirectedNeighbor(ctx, source, direction)
|
||||
assert destination
|
||||
logging.info('to object: %s', destination)
|
||||
@ -471,7 +470,7 @@ def bond_strength_tester(ctx, codelet):
|
||||
__showWhichStringObjectIsFrom(bond)
|
||||
bond.updateStrength()
|
||||
strength = bond.totalStrength
|
||||
#Todo: use entropy
|
||||
# TODO: use entropy
|
||||
probability = temperature.getAdjustedProbability(strength / 100.0)
|
||||
logging.info('bond strength = %d for %s', strength, bond)
|
||||
assert random.coinFlip(probability)
|
||||
|
||||
Reference in New Issue
Block a user