added method ENgetaveragepatternvalue. modified ENgetbasedemand and ENgetdemandpattern to use pattern index starting with 1, consistent with other API functions.