class ModulePopulation(object):
    def __init__(self, name, parameters):
        self.name=name
        self.parameters=parameters
        for k, v in parameters.items():
            setattr(self, k, v)

        self.activations=np.zeros((self.number_of_neurons,1)).flatten()

    def __str__(self):
        return self.name
    def __repr__(self):
        return self.name


class ModulePopulationPolar(ModulePopulation):
    def __init__(self, name, parameters):
        super(ModulePopulationPolar, self).__init__(name, parameters)

    	if self.receptive_field_parameters["type"]=="GAUSSIAN":
            self.receptive_fields=self.generate_receptive_fields_gaussian()

        elif self.receptive_field_parameters["type"]=="SINE_MULTILEVEL":
            self.receptive_fields=self.generate_receptive_fields_sine()

    def self.generate_receptive_fields_gaussian(self):
        i_neuron_total=0
        for i_level, n_neurons_current_level in enumerate(self.receptive_field_parameters["n_neurons_per_level"]):
            for i_neuron_current_level in range(n_neurons_current_level):
                receptive_field=GaussianReceptiveField(mu, sigma)
                self.receptive_fields[i_neuron_total]=receptive_field
                i_neuron_total+=1


    def self.generate_receptive_fields_sine(self):
        i_neuron_total=0
        for i_level, n_neurons_current_level in enumerate(self.receptive_field_parameters["n_neurons_per_level"]):
            for i_neuron_current_level in range(n_neurons_current_level):
                receptive_field=ReceptiveFieldSine(mu, sigma)
                self.receptive_fields[i_neuron_total]=receptive_field
                i_neuron_total+=1
        


