Define hashCode for individuals and variables.