A unified framework for force-based and energy-based adaptive resolution simulations