@@ -32,6 +32,10 @@ def __init__(self, blackboard):
32
32
self .blackboard = blackboard
33
33
34
34
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
+ """
35
39
while self .blackboard .common_state ["progress" ] < 100 :
36
40
for expert in self .blackboard .experts :
37
41
if expert .is_eager_to_contribute :
@@ -50,6 +54,26 @@ def is_eager_to_contribute(self):
50
54
51
55
@abc .abstractmethod
52
56
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
+ """
53
77
raise NotImplementedError ("Must provide implementation in subclass." )
54
78
55
79
@@ -59,6 +83,26 @@ def is_eager_to_contribute(self):
59
83
return True
60
84
61
85
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
+ """
62
106
self .blackboard .common_state ["problems" ] += random .randint (1 , 10 )
63
107
self .blackboard .common_state ["suggestions" ] += random .randint (1 , 10 )
64
108
self .blackboard .common_state ["contributions" ] += [self .__class__ .__name__ ]
@@ -71,6 +115,26 @@ def is_eager_to_contribute(self):
71
115
return random .randint (0 , 1 )
72
116
73
117
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
+ """
74
138
self .blackboard .common_state ["problems" ] += random .randint (10 , 20 )
75
139
self .blackboard .common_state ["suggestions" ] += random .randint (10 , 20 )
76
140
self .blackboard .common_state ["contributions" ] += [self .__class__ .__name__ ]
@@ -83,6 +147,26 @@ def is_eager_to_contribute(self):
83
147
return True if self .blackboard .common_state ["problems" ] > 100 else False
84
148
85
149
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
+ """
86
170
self .blackboard .common_state ["problems" ] += random .randint (1 , 2 )
87
171
self .blackboard .common_state ["suggestions" ] += random .randint (10 , 20 )
88
172
self .blackboard .common_state ["contributions" ] += [self .__class__ .__name__ ]
0 commit comments