+}
+/**************************************************************************************************/
+EstOutput Parsimony::driver(Tree* t, vector< vector<string> > namesOfGroupCombos, int start, int num, CountTable* ct) {
+ try {
+
+ EstOutput results; results.resize(num);
+
+ Tree* copyTree = new Tree(ct);
+ int count = 0;
+
+ for (int h = start; h < (start+num); h++) {
+
+ if (m->control_pressed) { delete copyTree; return results; }
+
+ int score = 0;
+
+ //groups in this combo
+ vector<string> groups = namesOfGroupCombos[h];
+
+ //copy users tree so that you can redo pgroups
+ copyTree->getCopy(t);
+
+ //create pgroups that reflect the groups the user want to use
+ for(int i=copyTree->getNumLeaves();i<copyTree->getNumNodes();i++){
+ copyTree->tree[i].pGroups = (copyTree->mergeUserGroups(i, groups));
+ }
+
+ for(int i=copyTree->getNumLeaves();i<copyTree->getNumNodes();i++){
+
+ if (m->control_pressed) { return data; }
+
+ int lc = copyTree->tree[i].getLChild();
+ int rc = copyTree->tree[i].getRChild();
+
+ int iSize = copyTree->tree[i].pGroups.size();
+ int rcSize = copyTree->tree[rc].pGroups.size();
+ int lcSize = copyTree->tree[lc].pGroups.size();
+
+ //if isize are 0 then that branch is to be ignored
+ if (iSize == 0) { }
+ else if ((rcSize == 0) || (lcSize == 0)) { }
+ //if you have more groups than either of your kids then theres been a change.
+ else if(iSize > rcSize || iSize > lcSize){
+ score++;
+ }
+ }
+
+ results[count] = score;
+ count++;
+ }
+
+ delete copyTree;
+
+ return results;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Parsimony", "driver");