import nest
import nest.voltage_trace
import random

nest.ResetKernel()

neuron1 = nest.Create('iaf_psc_alpha')
voltmeter = nest.Create("voltmeter")
nest.Connect(voltmeter, neuron1)

syn_dict_e = {'model': 'static_synapse', 'weight': 500., 'delay': 0.1}
syn_dict_i = {'model': 'static_synapse', 'weight': -500., 'delay': 0.1}

###################### CODE BLOCK IN QUESTION ####################
nest.SetKernelStatus({'rng_seeds': [45]})
noise_exc = nest.Create('poisson_generator', params={'rate': 300.})

nest.SetKernelStatus({'rng_seeds': [11]})
#print(nest.GetKernelStatus({'rng_seeds'}))
noise_inh = nest.Create('poisson_generator', params={'rate': 300.})

###################### CODE BLOCK IN QUESTION ####################

nest.Connect(noise_exc, neuron1, syn_spec= syn_dict_e)
nest.Connect(noise_inh, neuron1, syn_spec= syn_dict_i)

nest.Simulate(600.0)

nest.voltage_trace.from_device(voltmeter)
nest.voltage_trace.show()

############### TRIVIAL CASE ###########
random.seed(3)
x = random.random() #noise_exc
random.seed(0)
y = random.random() #noise_inh
print('x is ', x, 'y is ', y)

random.seed(0)
y = random.random() #noise_inh
random.seed(3)
x = random.random() #noise_exc
print('x is ', x ,'y is ', y)