@@ -32,6 +32,10 @@ def __init__(self, blackboard):
3232 self .blackboard = blackboard
3333
3434 def run_loop (self ):
35+ """
36+ This function is a loop that runs until the progress reaches 100.
37+ It checks if an expert is eager to contribute and then calls its contribute method.
38+ """
3539 while self .blackboard .common_state ["progress" ] < 100 :
3640 for expert in self .blackboard .experts :
3741 if expert .is_eager_to_contribute :
@@ -50,6 +54,26 @@ def is_eager_to_contribute(self):
5054
5155 @abc .abstractmethod
5256 def contribute (self ):
57+ """
58+ This function is responsible for contributing to the common state of the project.
59+ It adds a random number between 1 and 2 to problems, between 10 and
60+ 20 suggestions,
61+ and it adds this class name to contributions. It also increments progress by a random number between 10 and 100.
62+ """
63+ """
64+ :param self:
65+ :returns None:
66+ """
67+ """
68+ This function is responsible for contributing to the project.
69+ It adds a random number of problems and suggestions, as well as adding its name to the
70+ list of contributions.
71+ """
72+ """
73+ This function adds a random number of problems and suggestions to the common state,
74+ and also adds its name to the list of contributions. It also
75+ increments progress by a random number between 10 and 100.
76+ """
5377 raise NotImplementedError ("Must provide implementation in subclass." )
5478
5579
@@ -59,6 +83,26 @@ def is_eager_to_contribute(self):
5983 return True
6084
6185 def contribute (self ):
86+ """
87+ This function is responsible for contributing to the common state of the project.
88+ It adds a random number between 1 and 2 to problems, between 10 and
89+ 20 suggestions,
90+ and it adds this class name to contributions. It also increments progress by a random number between 10 and 100.
91+ """
92+ """
93+ :param self:
94+ :returns None:
95+ """
96+ """
97+ This function is responsible for contributing to the project.
98+ It adds a random number of problems and suggestions, as well as adding its name to the
99+ list of contributions.
100+ """
101+ """
102+ This function adds a random number of problems and suggestions to the common state,
103+ and also adds its name to the list of contributions. It also
104+ increments progress by a random number between 10 and 100.
105+ """
62106 self .blackboard .common_state ["problems" ] += random .randint (1 , 10 )
63107 self .blackboard .common_state ["suggestions" ] += random .randint (1 , 10 )
64108 self .blackboard .common_state ["contributions" ] += [self .__class__ .__name__ ]
@@ -71,6 +115,26 @@ def is_eager_to_contribute(self):
71115 return random .randint (0 , 1 )
72116
73117 def contribute (self ):
118+ """
119+ This function is responsible for contributing to the common state of the project.
120+ It adds a random number between 1 and 2 to problems, between 10 and
121+ 20 suggestions,
122+ and it adds this class name to contributions. It also increments progress by a random number between 10 and 100.
123+ """
124+ """
125+ :param self:
126+ :returns None:
127+ """
128+ """
129+ This function is responsible for contributing to the project.
130+ It adds a random number of problems and suggestions, as well as adding its name to the
131+ list of contributions.
132+ """
133+ """
134+ This function adds a random number of problems and suggestions to the common state,
135+ and also adds its name to the list of contributions. It also
136+ increments progress by a random number between 10 and 100.
137+ """
74138 self .blackboard .common_state ["problems" ] += random .randint (10 , 20 )
75139 self .blackboard .common_state ["suggestions" ] += random .randint (10 , 20 )
76140 self .blackboard .common_state ["contributions" ] += [self .__class__ .__name__ ]
@@ -83,6 +147,26 @@ def is_eager_to_contribute(self):
83147 return True if self .blackboard .common_state ["problems" ] > 100 else False
84148
85149 def contribute (self ):
150+ """
151+ This function is responsible for contributing to the common state of the project.
152+ It adds a random number between 1 and 2 to problems, between 10 and
153+ 20 suggestions,
154+ and it adds this class name to contributions. It also increments progress by a random number between 10 and 100.
155+ """
156+ """
157+ :param self:
158+ :returns None:
159+ """
160+ """
161+ This function is responsible for contributing to the project.
162+ It adds a random number of problems and suggestions, as well as adding its name to the
163+ list of contributions.
164+ """
165+ """
166+ This function adds a random number of problems and suggestions to the common state,
167+ and also adds its name to the list of contributions. It also
168+ increments progress by a random number between 10 and 100.
169+ """
86170 self .blackboard .common_state ["problems" ] += random .randint (1 , 2 )
87171 self .blackboard .common_state ["suggestions" ] += random .randint (10 , 20 )
88172 self .blackboard .common_state ["contributions" ] += [self .__class__ .__name__ ]
0 commit comments