def recruit(self):
num_approved = len(Participant.query.filter_by(status="<STR_LIT>").all())<EOL>end_of_generation = num_approved % self.generation_size == <NUM_LIT:0><EOL>complete = num_approved >= (self.generations * self.generation_size)<EOL>if complete:<EOL><INDENT>self.log("<STR_LIT>", "<STR_LIT>")<EOL>self.recruiter.close_recruitment()<EOL><DEDENT>elif end_of_generation:<EOL><INDENT>self.log("<STR_LIT>")<EOL>self.recruiter.recruit(n=self.generation_size)<EOL><DEDENT>
Recruit participants if necessary.