def getParticleInfos(self, swarmId=None, genIdx=None, completed=None,<EOL>matured=None, lastDescendent=False):
<EOL>if swarmId is not None:<EOL><INDENT>entryIdxs = self._swarmIdToIndexes.get(swarmId, [])<EOL><DEDENT>else:<EOL><INDENT>entryIdxs = list(range(len(self._allResults)))<EOL><DEDENT>if len(entryIdxs) == <NUM_LIT:0>:<EOL><INDENT>return ([], [], [], [], [])<EOL><DEDENT>particleStates = []<EOL>modelIds = []<EOL>errScores = []<EOL>completedFlags = []<EOL>maturedFlags = []<EOL>for idx in entryIdxs:<EOL><INDENT>entry = self._allResults[idx]<EOL>if swarmId is not None:<EOL><INDENT>assert (not entry['<STR_LIT>'])<EOL><DEDENT>modelParams = entry['<STR_LIT>']<EOL>isCompleted = entry['<STR_LIT>']<EOL>isMatured = entry['<STR_LIT>']<EOL>particleState = modelParams['<STR_LIT>']<EOL>particleGenIdx = particleState['<STR_LIT>']<EOL>particleId = particleState['<STR_LIT:id>']<EOL>if genIdx is not None and particleGenIdx != genIdx:<EOL><INDENT>continue<EOL><DEDENT>if completed is not None and (completed != isCompleted):<EOL><INDENT>continue<EOL><DEDENT>if matured is not None and (matured != isMatured):<EOL><INDENT>continue<EOL><DEDENT>if lastDescendentand (self._particleLatestGenIdx[particleId] != particleGenIdx):<EOL><INDENT>continue<EOL><DEDENT>particleStates.append(particleState)<EOL>modelIds.append(entry['<STR_LIT>'])<EOL>errScores.append(entry['<STR_LIT>'])<EOL>completedFlags.append(isCompleted)<EOL>maturedFlags.append(isMatured)<EOL><DEDENT>return (particleStates, modelIds, errScores, completedFlags, maturedFlags)<EOL>
Return a list of particleStates for all particles we know about in
        the given swarm, their model Ids, and metric results.

        Parameters:
        ---------------------------------------------------------------------
        swarmId:  A string representation of the sorted list of encoders in this
                     swarm. For example '__address_encoder.__gym_encoder'

        genIdx:  If not None, only return particles at this specific generation
                      index.

        completed:   If not None, only return particles of the given state (either
                    completed if 'completed' is True, or running if 'completed'
                    is false

        matured:   If not None, only return particles of the given state (either
                    matured if 'matured' is True, or not matured if 'matured'
                    is false. Note that any model which has completed is also
                    considered matured.

        lastDescendent: If True, only return particles that are the last descendent,
                    that is, the highest generation index for a given particle Id

        retval:  (particleStates, modelIds, errScores, completed, matured)
                  particleStates: list of particleStates
                  modelIds: list of modelIds
                  errScores: list of errScores, numpy.inf is plugged in
                                  if we don't have a result yet
                  completed: list of completed booleans
                  matured: list of matured booleans