def connections_on(self, gid): src = self.num_cells()-1 if gid==0 else gid-1 return [connection(cmem(src,0), cmem(gid,0), 0.1, 10)]
def connections_on(self, gid): # ================================ TASK 1 ================================ # # e) Define the source of cell with gid as the previous cell with gid-1 # caution: close the ring at gid 0 src = #TODO# return [connection(cmem(src,0), cmem(gid,0), 0.1, 10)]
def connections_on(self, gid): # ================================ SOLUTION 1 ================================ # # 1e) Define the source of cell with gid as the previous cell with gid-1 # caution: close the ring at gid 0 src = self.num_cells()-1 if gid==0 else gid-1 return [connection(cmem(src,0), cmem(gid,0), 0.1, 10)]