Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void forecast(final String sISO, final String sSourceEdition, final String sForecastEdition, final GTTimestamp[] gtDates, final GTTimestamp gtForecastStartDate, final GTTimestamp gtForecastEndDate, final String[] sCommodities, final Map<String, String> mapModFunc) throws Exception {
- String modFunction = "";
- for (Entry<String, String> ent : mapModFunc.entrySet()) {
- modFunction = ent.getValue();
- }
- Double[][] dModFunctions = getModFunctionValue(modFunction);
- GTTimestamp targetDate = gtForecastStartDate;
- String[] lmpGroups = {
- "WIND"
- };
- String[] commodityNames = {
- "Energy"
- };
- if (dModFunctions != null) {
- //Next Hour Share Same Function
- boolean bSharingFunction = false;
- GTTimestamp savingDateStart = null;
- GTTimestamp savingDateEnd = null;
- for (int h = 0; h < TOTAL_FUNC_HOURS; h++) {
- //Initiate Start Date
- if ((savingDateStart == null) || !bSharingFunction) {
- savingDateStart = targetDate.clone().add(Calendar.HOUR, h);
- }
- //Set End Date to match the loop
- savingDateEnd = targetDate.clone().add(Calendar.HOUR, h);
- //Check next hour if using the same function if so, wait to calculate all together
- if (((h + 1) < TOTAL_FUNC_HOURS) && isSameFunction(dModFunctions[h], dModFunctions[h + 1])) {
- bSharingFunction = true;
- continue;
- }
- bSharingFunction = false;
- // //String isoName, String sourceEdition, String forecastEdition, String[] lmpGroupNames,
- // //GTTimestamp[] sourceDates, GTTimestamp startForecastDate, GTTimestamp endForecastDate,
- // //String[] commodityNames, Map<String,String> modificationFunctions
- LMPForecastCreator.createForecast(sISO, sSourceEdition, sForecastEdition, lmpGroups, gtDates, gtForecastStartDate, gtForecastEndDate, commodityNames, mapModFunc);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement