Control, forecasting and optimisation for wave energy conversion