A Bayesian Genetic Algorithm for Calculating Maximum Entropy Distributions