'Returns the weighted distance for a named penalty.'

def __getitem__(self, key):

    dist = (sum(self._penalties[key]) * self._weights[key])
    dist_max = self.max_distance
    if dist_max:
        return (dist / dist_max)
    return 0.0
