1. A controller for controlling a CHP system, the system including a local generator for electricity, a fuel source, connections to an external electric power source, and a number of operational components including heating and cooling devices, the controller configured to perform the steps of: estimating future load conditions for thermal and power loads; performing a first analysis using a first operational strategy to generate a first future cost figure for the cost of operating the CHP system; performing a second analysis using a second operational strategy to generate a second future cost figure for the cost of operating the CHP system; comparing the first future cost figure to the second future cost figure; and selecting the operational strategy corresponding to the lesser cost figure.