def _build_connections(self, traj, brian_list, network_dict):
connections = traj.connections<EOL>neurons_i = network_dict['<STR_LIT>']<EOL>neurons_e = network_dict['<STR_LIT>']<EOL>print('<STR_LIT>')<EOL>self.conn_ii = Synapses(neurons_i,neurons_i, on_pre='<STR_LIT>' % connections.J_ii)<EOL>self.conn_ii.connect('<STR_LIT>', p=connections.p_ii)<EOL>print('<STR_LIT>')<EOL>self.conn_ei = Synapses(neurons_i,neurons_e, on_pre='<STR_LIT>' % connections.J_ei)<EOL>self.conn_ei.connect('<STR_LIT>', p=connections.p_ei)<EOL>print('<STR_LIT>')<EOL>self.conn_ie = Synapses(neurons_e,neurons_i, on_pre='<STR_LIT>' % connections.J_ie)<EOL>self.conn_ie.connect('<STR_LIT>', p=connections.p_ie)<EOL>conns_list = [self.conn_ii, self.conn_ei, self.conn_ie]<EOL>if connections.R_ee > <NUM_LIT:1.0>:<EOL><INDENT>cluster_list=[]<EOL>cluster_conns_list=[]<EOL>model=traj.model<EOL>clusters = int(model.N_e/connections.clustersize_e)<EOL>traj.f_add_derived_parameter('<STR_LIT>', clusters, comment='<STR_LIT>')<EOL>p_out = (connections.p_ee*model.N_e) /(connections.R_ee*connections.clustersize_e+model.N_e- connections.clustersize_e)<EOL>p_in = p_out * connections.R_ee<EOL>traj.f_add_derived_parameter('<STR_LIT>', p_in ,<EOL>comment='<STR_LIT>')<EOL>traj.f_add_derived_parameter('<STR_LIT>', p_out ,<EOL>comment='<STR_LIT>')<EOL>low_index = <NUM_LIT:0><EOL>high_index = connections.clustersize_e<EOL>for irun in range(clusters):<EOL><INDENT>cluster = neurons_e[low_index:high_index]<EOL>print('<STR_LIT>' % (irun, clusters))<EOL>conn = Synapses(cluster,cluster,<EOL>on_pre='<STR_LIT>' % (connections.J_ee*connections.strength_factor))<EOL>conn.connect('<STR_LIT>', p=p_in)<EOL>cluster_conns_list.append(conn)<EOL>if low_index > <NUM_LIT:0>:<EOL><INDENT>rest_low = neurons_e[<NUM_LIT:0>:low_index]<EOL>print('<STR_LIT>')<EOL>low_conn = Synapses(cluster,rest_low,<EOL>on_pre='<STR_LIT>' % connections.J_ee)<EOL>low_conn.connect('<STR_LIT>', p=p_out)<EOL>cluster_conns_list.append(low_conn)<EOL><DEDENT>if high_index < model.N_e:<EOL><INDENT>rest_high = neurons_e[high_index:model.N_e]<EOL>print('<STR_LIT>')<EOL>high_conn = Synapses(cluster,rest_high,<EOL>on_pre='<STR_LIT>' % connections.J_ee)<EOL>high_conn.connect('<STR_LIT>', p=p_out)<EOL>cluster_conns_list.append(high_conn)<EOL><DEDENT>low_index=high_index<EOL>high_index+=connections.clustersize_e<EOL><DEDENT>self.cluster_conns=cluster_conns_list<EOL>conns_list+=cluster_conns_list<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>')<EOL>self.conn_ee = Synapses(neurons_e,neurons_e,<EOL>on_pre='<STR_LIT>' % connections.J_ee)<EOL>self.conn_ee.connect('<STR_LIT>', p=connections.p_ee)<EOL>conns_list.append(self.conn_ee)<EOL><DEDENT>brian_list.extend(conns_list)<EOL>network_dict['<STR_LIT>'] = conns_list<EOL>
Connects neuron groups `neurons_i` and `neurons_e`.

        Adds all connections to `brian_list` and adds a list of connections
        with the key 'connections' to the `network_dict`.