Skip to content

Commit e834385

Browse files
committed
Retry
1 parent 9ad7206 commit e834385

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

patterns/other/blackboard.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from abc import ABC, abstractmethod
1313
import random
1414

15+
1516
class 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

3132
class 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

140141
if __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()

0 commit comments

Comments
 (0)