set_availability_breakpoints

Set the availability for a renewable resource on a given breakpoint to a new value.

This function assumes that a breakpoint has been initially added using the P2Resource:add_breakpoint_to_availability function. Therefore, this function is similar to the P2Resource:add_breakpoint_to_availability function but does not increase the number of breakpoints. Instead, it returns a 1 when the availability has been reset to the new value, or 0 when the reset has failed since the breakpoint ID does not exist. The ID of the breakpoint is an input argument of the function and ranges from zero to the number of breakpoints - 1.
 
Parameters: 
I/O Type Name Description
input integer ID resource ID
input integer breakpoint ID ID of breakpoint start date
input float availability new availability
output boolean success 0 (failure) or 1 (successful)
Example: 
function ()
        io.write('\n')
end
Class: 
P2Resource