aggregator-core/src/main/java/org/arrowhead/wp5/agg/optim/FlexOfferPortfolio.java
public double computeTotalEnergy(long tid) {
		double totalEnergy = 0;
		for (int i=0; i < this.fos.size(); i++) {
			FlexOffer f = this.fos.get(i);
			FlexOfferSchedule sch = f.getFlexOfferSchedule();
			
			if (sch == null) continue;
			
			for(int j=0; j<sch.getEnergyAmounts().length; j++) {
				long t = sch.getStartInterval() + j;
				
				if (t == tid) {
					totalEnergy += sch.getEnergyAmount(j);
				}
			}			
		}
		
		return totalEnergy;
	}
/**
	  * Compute the total energy at specific tid 
	  * @param tid
	  * @return
	  */
Compute the total energy at specific tid
@param tid
@return
Compute the total energy at specific tid @param tid @return
public double computeTotalEnergy(long tid) {
		double totalEnergy = 0;
		for (int i=0; i < this.fos.size(); i++) {
			FlexOffer f = this.fos.get(i);
			FlexOfferSchedule sch = f.getFlexOfferSchedule();
			if (sch == null) continue;
			for(int j=0; j<sch.getEnergyAmounts().length; j++) {
				long t = sch.getStartInterval() + j;
				if (t == tid) {
					totalEnergy += sch.getEnergyAmount(j);
				}
			}			
		}
		return totalEnergy;
	}
public double computeTotalEnergy ( long tid ) { double totalEnergy = 0 ; for ( int i = 0 ; i < this . fos . size ( ) ; i ++ ) { FlexOffer f = this . fos . get ( i ) ; FlexOfferSchedule sch = f . getFlexOfferSchedule ( ) ; if ( sch == null ) continue ; for ( int j = 0 ; j < sch . getEnergyAmounts ( ) . length ; j ++ ) { long t = sch . getStartInterval ( ) + j ; if ( t == tid ) { totalEnergy += sch . getEnergyAmount ( j ) ; } } } return totalEnergy ; }
Compute the total energy at specific tid
 @param tid
 @return
Compute the total energy at specific tid @param tid @return