#
# Retrieve statistical inflow data
#
p25ValueByMinutes = currentVariable.varGet("p25ValueByMinutes")
p50ValueByMinutes = currentVariable.varGet("p50ValueByMinutes")
inflowData        = currentVariable.varGet("inflowData")
#
# Retrieve the inflow and HecTime minutes values for the current time step
#
inflowTS = network.getTimeSeries("Reservoir","Crazy Mountain", "Pool", "Flow-IN")
inflow = inflowTS.getCurrentValue(currentRuntimestep)
minutes = currentRuntimestep.valueMinutes()
#
# Get the statistical inflow vaules for the current time step
#
p25Inflow = p25ValueByMinutes[minutes]
p50Inflow = p50ValueByMinutes[minutes]
#
# Set the max release based on comparing the current inflow with statistical values
#
if inflow < p25Inflow :
	maxRelease = 4000
elif inflow < p50Inflow :
	maxRelease = 6000
else :
	maxRelease = inflow
#
# set the value of this state variable to our computed value
#
currentVariable.setValue(currentRuntimestep, maxRelease)