EP project:

Analyze simulation results
------------------------------------------------
22 May: DONE

simulate response of EP to synaptic inputs POST plasticity, compare with PRE plasticity

POST: make str inputs 140% of current value (weight=1.4)
      make GP inputs 40% of current value (weight=0.8 - 0.4*2.0)
      make STN inputs 60% of current value (weight=0.6)
CHANGE FILENAME to avoid overwriting current files
for above, do syn='non', stimfreqs=[0], stpYN=1 (and possibly 0)(1 set of 16)
possible repeat str and GPe response to 20 and 40 with stpYN=1 (2 sets of 16)

--------------------------------------------
Start simulations on 21 May:
DA: block Da means Gpe-> EP is 140% post 100 Hz, str -> EP have no change

POST/No_Da: make str inputs 100% of current value (weight=1)
      make GP inputs 140% of current value (weight=2.8)
      make STN inputs 100% of current value (weight=1)
      do syn='non', stimfreqs=[0], stpYN=1 (1 set of 16)
possible repeat str and GPe response to 20 and 40 with stpYN=1 (2 sets of 16)
--------------------------------------------
Still need syn='non' for POST-HFS

When stimulating a single (extra) synapse:
possibly "reserve" the synapse from random time tables 
   e.g. call create_model_sim.setupStim(model) after creating pop but before connecting time_tables
################################################################
NOT NEEDED 1. try another opt with smaller window for AHP (after GP opt finished)
2. create 3 different time tables - Str,GPe, STN, and update  connection probability to be realistic
DONE 3. edit connect.py to allow specification of spatial location
DONE   a. create_synpath_array: add another entry - distance to soma
       add one entry per SynPerComp - which is now difference between NumSyn and existing synapses
          syncomps.append([syncomp.path,dist])
****NEEDED: do not add synapses to axon, or add them but somehow indicate they are axon?
DONE   b. update ext_connect to use
   #postsyn_fraction=None, half_dist=None, steep=none,mindist=0,maxdist=1 (units are meters)
   #require either fraction or half_dist, default steep=1 if half_dist defined

DONE   c. update select_entry and connect_timetable to use choice and probability and distance_range
NOT POSSIBLE   i.e., eliminate select_entry!
DONE     replicate entries according to NumSyn
DONE     calculate probability at each location/branch
       prob=0 if dist<mindist
       prob=1 if dist>maxdist
       if half_dist defined:
       	  prob=dist^steep/(dist^steep+half_dist^steep), make steep<0 to switch slope
DONE       	  recalc probabilities as choice_prob=prob/sum(prob)
	if postsyn_fraction:
	      choice_prob=1/total_syn) inside range
DONE      num_choices=np.int(np.round(totalsyn*postsyn_fraction))
DONE      syn_choices=np.random.choice(syncomp_subset,size=num_choices,replace=false)

DONE selection of timetable still uses select_entry because
     the table of tt entries with number of times to be used is the only place that keeps track of which tts have been used,
     because the set of time tables is for the entire network
modify create_synpath_array:
DONE	prior to each set of connections (after :  for pretype in post_connections[syntype].keys():), generate list from available connections
DONE	name is full path to synhandler, cross-reference with number of allowed synapses vs distance
DONE	i.e., SynPerComp = (distance_mapping - sh.synapse.num)
DONE	need to create sh when creating synchan, in addoneSynChan in syn_proto.py

DONE intrinsic will be similarly modified to use np.random.choice
DONE   store list of pre-cells (spikegens) where connect<prob, length=
DONE   syn_choices=np.random.choice(syncomp_subset,size=min(num_pre_cell_spikegens,length(syncomps)),replace=false)
DONE test dend_loc=something for intrinsic connections
DONE allow multiple connections between a pair of pre and post-syn neurons

##################
ISSUES:
new create_model_sim functions do put EVERYTHING under model.  It does simplify returns, but makes code less clear.
We do not want user to have to read the create_model_sim code to see how things are working.  By returning a few things, it is more clear
I would prefer to return tables from setupOutput, possible collected under Output variable to simplify
I would prefer to return the pulsegenerator as pg
And, I would prefer to keep param_sim not under model

Bigger issue: need for net.num_inject to override current injection specification in param_sim.py

####################
Then, update __main__.py in network simulations to use create_model_sim as much as possible