A Statistical Mechanics approach to autopoietic immune networks