<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_number_of_atoms( self, n, selected_sites=None ):
 """ Set the number of atoms for the simulation, and populate the simulation lattice. Args: n (Int):
 Number of atoms for this simulation. selected_sites (:obj:(List|Set|String), optional):
 Selects a subset of site types to be populated with atoms. Defaults to None. Returns: None """

        self.number_of_atoms = n
        self.atoms = species.Species( self.lattice.populate_sites( self.number_of_atoms, selected_sites=selected_sites ) )