Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ccm/lib/actr/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import ccm
import collections
import typing

class ACTR(ccm.ProductionSystem):
production_time_sd=None
Expand All @@ -26,7 +26,7 @@ def _process_productions(self):
a=max(activations)

threshold=self.production_threshold
if isinstance(threshold, collections.Callable): threshold=threshold()
if isinstance(threshold, typing.Callable): threshold=threshold()

if threshold is not None and a<threshold:
for a in self._adaptors: a.below_threshold()
Expand All @@ -40,7 +40,7 @@ def _process_productions(self):
self.log.production=choice.name

t=self.production_time
if isinstance(t, collections.Callable): t=t()
if isinstance(t, typing.Callable): t=t()
if self.production_time_sd is not None:
t=t+self.random.gauss(0,self.production_time_sd)
t-=self.production_match_delay
Expand Down
4 changes: 2 additions & 2 deletions ccm/pattern.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
import collections
import typing

class PatternException(Exception):
pass
Expand Down Expand Up @@ -91,7 +91,7 @@ def parse(patterns,bound=None):
if p is None:
if name is None: funcs.append(lambda x,b: x==None)
else: funcs.append(lambda x,b,name=name: x[name]==None or len(x[name])==0)
elif isinstance(p, collections.Callable):
elif isinstance(p, typing.Callable):
if name is None:
def callfunc(x,b,name=name,p=p):
return p(x,b)
Expand Down