mars0i / popco2

Cultural transmission with analogy biases.
GNU General Public License v3.0
3 stars 0 forks source link

Possible bug with single-member groups #17

Closed mars0i closed 10 years ago

mars0i commented 10 years ago

See grouptest1.clj for an example. The pundits group has only one member. The other groups have at least two. The groups hashmap in popn has a seq as a val for each of the group keys except pundits; the val there is simply the person id, :aa. That can't be right.

mars0i commented 10 years ago

Fixed. The problem was that utils.general/join-pairs-to-coll-map, called by utils.general/invert-coll-map, in turn called by popco.core.population/make-population, used merge-with, which does no merging or anything when there is only one value to merge. So in those cases, the value (a group id) didn't get wrapped in vector. Added an additional step in join-pairs-to-coll-map to guarantee that this happens.