Generalized reliability based on distances