Skip to content

Commit

Permalink
Add activation to node when focused.
Browse files Browse the repository at this point in the history
  • Loading branch information
amahabal committed Feb 28, 2017
1 parent 1b97ff6 commit 60dba15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions farg/apps/pyseqsee/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def FocusOn(self, focusable, controller):
self.fringe_element_to_item_to_wt[fe][focusable] = wt
timestamp = controller.steps_taken
self.last_focus_time[focusable] = timestamp
controller.ltm.GetNode(content=focusable).IncreaseActivation(
5, current_time=controller.steps_taken)
actions = focusable.GetActions(controller)
prior_overlapping_foci = self.PriorFociWithSimilarFringe(
current_focus=focusable, timestamp=timestamp)
Expand Down
8 changes: 7 additions & 1 deletion farg/apps/pyseqsee/tests/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from farg.apps.pyseqsee.categorization.logic import PSCategory
from farg.apps.pyseqsee.controller import PSController
from farg.apps.pyseqsee.focusable import PSFocusable
from farg.apps.pyseqsee.objects import PSElement
from farg.apps.pyseqsee.objects import PSElement, PlatonicObject
from farg.apps.pyseqsee.stream import PSStream
from farg.apps.pyseqsee.tests.utils import FringeTest
from farg.apps.pyseqsee.ui import PySeqseeBatchUI
Expand All @@ -25,6 +25,9 @@ def CalculateFringe(self):
"""This fringe will be appended with a fringe coming from category membership."""
return {self.x: 1.0, (self.x + 1): 0.5, (self.x - 1): 0.5}

def GetLTMStorableContent(self):
return PlatonicObject(rep=str(self.x))

class FakeAttributeRichCategory(PSCategory):
_Attributes = ('att_1', 'att_2', 'att_3')
_Rules = ('att_1: PSElement(magnitude=1)',
Expand Down Expand Up @@ -74,6 +77,9 @@ def __init__(self, x):
def BriefLabel(self):
return 'F1'

def GetLTMStorableContent(self):
return PlatonicObject(rep=str(self.x))

def CalculateFringe(self):
"""This fringe will be appended with a fringe coming from category membership."""
return {self.x: 1.0, (self.x + 1): 0.5, (self.x - 1): 0.5}
Expand Down

0 comments on commit 60dba15

Please sign in to comment.