override Equals and GetHashCode for Agent