public List < T > apply ( List < T > selectedCandidates , Random rng ) { List < T > output = new ArrayList < T > ( selectedCandidates . size ( ) ) ; for ( T candidate : selectedCandidates ) { output . add ( replacementProbability . nextValue ( ) . nextEvent ( rng ) ? factory . generateRandomCandidate ( rng ) : candidate ) ; } return output ; }
Randomly replace zero or more of the selected candidates with new independent individuals that are randomly created .