A Prediction and Decision Framework for Energy Management in Smart Buildings