A statistical mechanics model of the adaptive immune system: static and dynamical analysis in different connectivity regimes