/** * Returns the difference between a broker's current market position and its * net load. Note: market position is computed in MWh and net load is computed * in kWh, conversion is needed to compute the difference in kWh. * * @return a broker's current energy balance within its market. Pos for * over-production, neg for under-production */ @Override public double getMarketBalance (Broker broker) { double result = accountingService.getCurrentMarketPosition(broker) * 1000.0 + accountingService.getCurrentNetLoad(broker); log.info("market balance for " + broker.getUsername() + ": " + result); return result; }