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

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

                    },
                'artificial_stimulators' : ref('sheets.l4_cortex_exc.params.artificial_stimulators'),
                'recording_interval'  :  ref('sheets.l4_cortex_exc.params.recording_interval'),                                            
                'recorders' : url("param_spont/l23_exc_rec"),    
    },
    
    'layer23_aff_ratio' : 0.22,
    'feedback_arborization_ratio' : 1,

    'K' : 2300, # Number of synapses per neuron
    
    'L23ExcL23ExcConnection': {
        'target_synapses' : 'excitatory',             
        'short_term_plasticity': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.short_term_plasticity'),                                            

        'weight_functions' : {  'f1' : {
                                         'component' : 'mozaik.connectors.vision.MapDependentModularConnectorFunction',
                                         'params' : {
                                                        'sigma' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.weight_functions.f1.params.sigma'),
                                                        'map_location' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_location'),                                            
                                                        'map_stretch' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_stretch'),                                            
                                                        'periodic' : True,
                                                    }
                                       }, 

                                'f2' : {
					'component' : 'mozaik.connectors.modular_connector_functions.GaussianDecayModularConnectorFunction',
					'params' : {
						'arborization_constant' : 270,
						'arborization_scaler' : 1.0,
					}
				},

                                'f3' : {
					'component' : 'mozaik.connectors.modular_connector_functions.GaussianDecayModularConnectorFunction',
					'params' : {
						'arborization_constant' : 1000,
						'arborization_scaler' : 4.0,
					}
				}
                             },

        'num_samples_functions' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_functions'),
        'delay_functions' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.delay_functions'),
        'delay_expression' : 'd1',
        'weight_expression' : 'f1*f3+f2',
        'num_samples_expression' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_expression'),
        'base_weight': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.base_weight'),
	'num_samples' : ref('sheets.l23_cortex_exc.K')*4/5*(1-ref('sheets.l23_cortex_exc.layer23_aff_ratio')),
        'self_connections': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.self_connections'),
        'local_module': None,
    },

    'L23ExcL23InhConnection': {
        'target_synapses' : 'excitatory',             
        'short_term_plasticity': ref('sheets.l4_cortex_exc.L4ExcL4InhConnection.short_term_plasticity'),                                            
	'weight_functions' : ref('sheets.l23_cortex_exc.L23ExcL23ExcConnection.weight_functions'),  
        'weight_functions' : {  'f1' : {
                                         'component' : 'mozaik.connectors.vision.MapDependentModularConnectorFunction',
                                         'params' : {
                                                        'sigma' : ref('sheets.l4_cortex_exc.L4ExcL4InhConnection.weight_functions.f1.params.sigma'),
                                                        'map_location' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_location'),                                            
                                                        'map_stretch' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_stretch'),                                            
                                                        'periodic' : True,
                                                    }
                                       }, 
                                'f2' : {
                                        'component' : 'mozaik.connectors.modular_connector_functions.GaussianDecayModularConnectorFunction',
                                        'params' : {
                                                'arborization_constant' : 270,
                                                'arborization_scaler' : 1.0,
                                        }
                                },
                                'f3' : {
                                        'component' : 'mozaik.connectors.modular_connector_functions.GaussianDecayModularConnectorFunction',
                                        'params' : {
                                                'arborization_constant' : 1000,
                                                'arborization_scaler' : 4.0,
                                        }
                                }
                             },
        'num_samples_functions' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_functions'),
        'delay_functions' : ref('sheets.l4_cortex_exc.L4ExcL4InhConnection.delay_functions'),
        'weight_expression' : ref('sheets.l23_cortex_exc.L23ExcL23ExcConnection.weight_expression'),
        'delay_expression' : ref('sheets.l4_cortex_exc.L4ExcL4InhConnection.delay_expression'),
        'num_samples_expression' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_expression'),
        'base_weight': 0.00035,
	'num_samples' : ref('sheets.l23_cortex_exc.L23ExcL23ExcConnection.num_samples') * ref('sheets.l4_cortex_exc.inhibitory_connection_ratio'),
        'self_connections': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.self_connections'),
        'local_module': None,
    },


    'L4ExcL23ExcConnection': {
        '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.modular_connector_functions.HyperbolicModularConnectorFunction',
                                         'params' : {
                                                	            'theta':  154.45,
	                                                            'alpha': 0.017452,
                                                    }
                                       },            
				'f2' : {
                                         'component' : 'mozaik.connectors.vision.MapDependentModularConnectorFunction',
                                         'params' : {
                                               	        'sigma' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.weight_functions.f1.params.sigma'),
                                                        'map_location' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_location'),                                            
                                                        'map_stretch' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_stretch'),                                            
                                                        'periodic' : True,
                                                    }
                                       }, 
                            
                                
                             },

        'delay_functions' : {
                                'd1' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.LinearModularConnectorFunction',
                                         'params' : {
                                                        'constant_scaler': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.delay_functions.d1.params.constant_scaler'),
                                                        'linear_scaler': 0,
                                                    }
                                       },
                            },
        'num_samples_functions' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_functions'),
        'delay_expression' : 'd1',
        'weight_expression' : 'f1*f2',
        'num_samples_expression' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_expression'),
        'base_weight': 0.001,
        'num_samples' : ref('sheets.l23_cortex_exc.layer23_aff_ratio')*ref('sheets.l23_cortex_exc.K')*4/5,
        'self_connections': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.self_connections'),
        'local_module': None,
    },

    'L23ExcL4ExcConnection': {
        'target_synapses' : 'excitatory',             
        'short_term_plasticity': {
                                        'U': 0.75,
                                        'tau_rec': 20,
                                        'tau_psc': 3.0,
                                        'tau_fac': 0.0,
        },

        'weight_functions' : {  'f1' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.GaussianDecayModularConnectorFunction',
                                         'params' : {
                                            	            'arborization_constant': 100.0,
                                                            'arborization_scaler': 1.0,
                                                    }
                                       },                                        

				'f2' : {
                                         'component' : 'mozaik.connectors.vision.MapDependentModularConnectorFunction',
                                         'params' : {
                                               	        'sigma' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.weight_functions.f1.params.sigma'),
                                                        'map_location' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_location'),                                            
                                                        'map_stretch' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_stretch'),                                            
                                                        'periodic' : True,
                                                    }
                                       }, 

                             },
        'delay_functions' : {
                                'd1' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.LinearModularConnectorFunction',
                                         'params' : {
                                                        'constant_scaler': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.delay_functions.d1.params.constant_scaler'),
                                                        'linear_scaler': 0,
                                                    }
                                       },
                            },
        'num_samples_functions' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_functions'),
        'delay_expression' : 'd1',
        'weight_expression' : 'f1*f2',
        'num_samples_expression' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_expression'),
        'base_weight': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.base_weight'),
        'num_samples' : ref('sheets.l4_cortex_exc.K')*4.0/5.0*ref('sheets.l4_cortex_exc.feedback_conn_ratio'),
        'self_connections': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.self_connections'),
        'local_module': None,
    },
    

    'L23ExcL4InhConnection': {
        'target_synapses' : 'excitatory',             
        'short_term_plasticity': ref('sheets.l23_cortex_exc.L23ExcL4ExcConnection.short_term_plasticity'), 
        'weight_functions' : {  'f1' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.GaussianDecayModularConnectorFunction',
                                         'params' : {
                                            	            'arborization_constant': ref('sheets.l23_cortex_exc.L23ExcL4ExcConnection.weight_functions.f1.params.arborization_constant') * ref('sheets.l23_cortex_exc.feedback_arborization_ratio'),
                                                            'arborization_scaler': 1.0,
                                                    }
                                       },                                        
				'f2' : {
                                         'component' : 'mozaik.connectors.vision.MapDependentModularConnectorFunction',
                                         'params' : {
                                               	        'sigma' : 3.0,
                                                        'map_location' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_location'),                                            
                                                        'map_stretch' : ref('sheets.l4_cortex_exc.AfferentConnection.or_map_stretch'),                                            
                                                        'periodic' : True,
                                                    }
                                       }, 

                             },

        'delay_functions' : {
                                'd1' : {
                                         'component' : 'mozaik.connectors.modular_connector_functions.LinearModularConnectorFunction',
                                         'params' : {
                                                        'constant_scaler': ref('sheets.l4_cortex_exc.L4ExcL4InhConnection.delay_functions.d1.params.constant_scaler'),
                                                        'linear_scaler': 0,
                                                    }
                                       },
                            },
        'num_samples_functions' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_functions'),
        'delay_expression' : 'd1',
        'weight_expression' : 'f1*f2',
        'num_samples_expression' : ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.num_samples_expression'),
        'base_weight': ref('sheets.l4_cortex_exc.L4ExcL4InhConnection.base_weight'),
	'num_samples' : ref('sheets.l23_cortex_exc.L23ExcL4ExcConnection.num_samples')*ref('sheets.l4_cortex_exc.inhibitory_connection_ratio'),
        'self_connections': ref('sheets.l4_cortex_exc.L4ExcL4ExcConnection.self_connections'),
        'local_module': None,
    },

}
