Solver.set stage

Hi! I want to know whether the method solver.set(i, 'yref', yref) sets from 0 to N - 1 or from 1 to N.
And also the p when to set i to 0? and when to N?