A criterion for the optimization of multi-layered walls in building-plant interaction