import sim_ballena as ballena
import matplotlib.pyplot as plt

gen0 = ballena.PoissonGenerator( [100],1 )
gen1 = ballena.PoissonGenerator( [-10],1.5 )

print( gen0.concat( gen1 ), gen1 )



# net = (ballena.Network( ballena.Lif().tau(2).repeat(4) )
#               .outputs([1,3,0,2])
#               .mode(['VOLTAGES','SPIKES']))



# # ==========
# #   STEP 1
# # ==========
# net.synapses_in([(0,0),(0,1),(0,2),(0,3)])
# net.synapses_net([[0,1]])
# net.weights([2,5,10,3,2])

# times = [ (1, 0) ]
# instance = ballena.Instance( times )
# res = net.simulate( instance, 2 ).set_resolution(0.001)

# print(res.v_state())
# print( res.spk_times() )
# print( res.spk_count() )

# time = res.time()
# volt = res.v_trace()

# plt.plot( time, volt[0], label='0')
# plt.plot( time, volt[1], label='1')
# plt.plot( time, volt[2], label='2')
# plt.plot( time, volt[3], label='3')
# plt.legend()
# plt.grid()

# plt.show()



