File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1212from abc import ABC , abstractmethod
1313import random
1414
15+
1516class AbstractExpert (ABC ):
1617 """Abstract class for experts in the blackboard system."""
1718 @abstractmethod
@@ -20,18 +21,18 @@ def __init__(self, blackboard) -> None:
2021
2122 @property
2223 @abstractmethod
23- def is_eager_to_contribute (self ):
24+ def is_eager_to_contribute (self ) -> bool :
2425 raise NotImplementedError ("Must provide implementation in subclass." )
2526
2627 @abstractmethod
27- def contribute (self ):
28+ def contribute (self ) -> None :
2829 raise NotImplementedError ("Must provide implementation in subclass." )
2930
3031
3132class Blackboard :
3233 """The blackboard system that holds the common state."""
3334 def __init__ (self ) -> None :
34- self .experts = []
35+ self .experts : list = [AbstractExpert ]
3536 self .common_state = {
3637 "problems" : 0 ,
3738 "suggestions" : 0 ,
@@ -138,7 +139,7 @@ def main():
138139
139140
140141if __name__ == "__main__" :
141- random .seed (1234 ) # for deterministic doctest outputs
142+ # random.seed(1234) # for deterministic doctest outputs
142143 import doctest
143144
144145 doctest .testmod ()
You can’t perform that action at this time.
0 commit comments