{
    #CorticalUniformSheet parameters
    'component': 'mozaik.sheets.vision.VisualCorticalUniformSheet',
    'params':{
                'name':'V1_Exc_L4',
                'sx':5000.0,
                'sy':ref('sheets.l4_cortex_exc.params.sx'),
                'density': 1500.0,
                'mpi_safe' : False,    
                'magnification_factor': 1000.0,
              
                    
                'cell': {
                        'model': 'EIF_cond_exp_isfa_ista',
                        'native_nest': False,
                        'params': {
                            'v_rest': -80,
                            'v_reset': -60.0,
                            'tau_refrac': 2.0,
                            'tau_m': 8.0,
                            'cm': 0.032,
            	            'e_rev_E': 0.0,
                            'e_rev_I': -80.0,
                    	    'tau_syn_E': 1.5,
                            'tau_syn_I': 4.2,
                            'a' : -0.8,
                            'b' : 0.08,
                            'delta_T' : 0.8,
                            'tau_w' : 1.0,
                            'v_thresh' : -57.0                            
                        },

                       'initial_values': {
                                    'v': PyNNDistribution(name='uniform',low=-70,high=-51),
                                },

                    },
                'artificial_stimulators' : {},
                'recording_interval'  :  1.0,                                                            
                'recorders' : url("param_spont/l4_exc_rec"),
    },

    'K' : 1000, # Number of synapses per neuron
    'feedback_conn_ratio' : 0.2,
    'inhibitory_connection_ratio' : 0.6, # The fraction of connections that are onto inhibitory neurons compared to excitatory

    'L4ExcL4ExcConnection': {
        'target_synapses' : 'excitatory',             
        'short_term_plasticity': {
				            'U': 0.75, 
				            'tau_rec': 30, 
	 		                'tau_psc': 3.0,
				            'tau_fac': 0.0,
                        },
        'weight_functions' : {                          
                                'f1' : {
                                         'component' : 'mozaik.connectors.vision.V1CorrelationBasedConnectivity',
                                         'params' : {
                                             	        'sigma' : 1.3,
                                                        'target_synapses' : 'excitatory',  
	                                            }
                                       }, 
                                'f2' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.HyperbolicModularConnectorFunction',
                                         'params' : {
                                                	            'theta': 207.76,
                                                                'alpha': 0.013944,
                                                    }
                                       },                                        
                             },
        'delay_functions' : {
                                'd1' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.LinearModularConnectorFunction',
                                         'params' : {
                                                        'constant_scaler': 1.4,
                                                        'linear_scaler': 0.0033333333,   
                                                    }
                                       }, 
        
                            },
        'num_samples_functions' : {
                                'n1' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.ThresholdExponentialModularNumSamplesConnectorFunction',
                                         'params' : {
                                                        'threshold': 0.1,
                                                        'max_decrease': 2,
                                                        'exponent_factor': 3,
                                                    }
                                       },
                            },
        'weight_expression' : 'f1*f2',
        'delay_expression' : 'd1',
        'num_samples_expression' : '',
        'base_weight': 0.00018,
	'annotation_reference_name' : 'aff_samples',
        'self_connections': True,
        'num_samples' : ref('sheets.l4_cortex_exc.K')*4.0/5.0*(1-ref('sheets.l4_cortex_exc.feedback_conn_ratio')),
            'local_module': None,
},
    
    
    'L4ExcL4InhConnection': {
        'target_synapses' : 'excitatory',             
                
        'short_term_plasticity': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.short_term_plasticity'),        
        'weight_functions' : {                          
                                'f1' : {
                                         'component' : 'mozaik.connectors.vision.V1CorrelationBasedConnectivity',
                                         'params' : {
                                             	        'sigma' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.weight_functions.f1.params.sigma'),
                                                        'target_synapses' : 'excitatory',  
	                                            }
                                       }, 
                                'f2' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.HyperbolicModularConnectorFunction',
                                         'params' : {
                                                	            'theta': 191.84,
                                                                'alpha': 0.014827,
                                                    }
                                       },                                        
                             },

        'delay_functions' : {
                                'd1' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.LinearModularConnectorFunction',
                                         'params' : {
                                                        'constant_scaler': 0.5,
                                                        'linear_scaler': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.delay_functions.d1.params.linear_scaler'),   
                                                    }
                                       }, 
        
                            },

        'num_samples_functions' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_functions'),
        'weight_expression' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.weight_expression'),
        'delay_expression' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.delay_expression'),
        'base_weight': 0.00022,
        'num_samples_expression' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_expression'),
	'annotation_reference_name' : 'aff_samples',
        'num_samples' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples') * ref('sheets.l4_cortex_exc.inhibitory_connection_ratio'),
        'self_connections': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.self_connections'),
        'local_module': None,
    },

    'AfferentMean' : 70,      
    'AfferentVar' : 25,

    'AfferentConnection': {
        'aspect_ratio':            0.4,
        'size':                    0.17,
        'orientation_preference':  PyNNDistribution(name='uniform',low=0,high=3.141592653589793),
        'phase':                   PyNNDistribution(name='uniform',low=0,high=6.283185307179586),
        'frequency':               0.8,

        'delay_expression': "f1",    
        'delay_functions' : {
                                "f1" : {
                                     'component' : 'mozaik.connectors.modular_connector_functions.PyNNDistributionConnectorFunction',
                                     'params' : {
                                                            'pynn_distribution': PyNNDistribution(name='uniform',low=1.4,high=2.4)
                                                }
                                }
                            },
        'num_samples_functions' : None,
        'num_samples_expression' : '',
        'topological' : True,
	    
        'or_map' : True,
        'or_map_location' : './or_map_new_16x16',
        'or_map_stretch' : 3.35,
        'phase_map' : False,
        'phase_map_location' : './phase_map',
        'rf_jitter' : 0,
        'off_bias' : 1.0,
        'gauss_coefficient' : 0.085,

        'base_weight' : 0.0012,
        'num_samples' : {
             'class_name': 'PyNNDistribution',
             'params': {
                     'name': 'uniform',
                     'low': ref('sheets.l4_cortex_exc.AfferentMean') - ref('sheets.l4_cortex_exc.AfferentVar'),
                     'high': ref('sheets.l4_cortex_exc.AfferentMean') + ref('sheets.l4_cortex_exc.AfferentVar'),
                 },
         },
        'short_term_plasticity': {
				        'U': 0.75, 
				        'tau_rec': 125.0, 
	 		                'tau_psc': 3.0,
				        'tau_fac': 0.0,
                        },


        'local_module': None,
    }        
}        
