Generalized metric spaces