The interaction between feedback from active galactic nuclei and supernovae