#include <fstream>
#include <iomanip>
#include <vector>
+#include <map>
/* This class represents a node on a tree. */
~Node() {};
void setName(string);
- void setGroup(string); //non leaf nodes will belong to multiple groups, leaf nodes will only belong to one.
+ void setGroup(string);
void setBranchLength(float);
void setParent(int);
void setChildren(int, int); //leftchild, rightchild
void setIndex(int);
string getName();
- vector<string> getGroup(); //leaf nodes will only have 1 group, but branch nodes may have multiple groups.
+ string getGroup();
float getBranchLength();
int getParent();
int getLChild();
int getRChild();
int getIndex();
-
void printNode(ostream&); //prints out the name and the branch length
+
+ //pGroup is the parsimony group info. i.e. for a leaf node it would contain 1 enter pGroup["groupname"] = 1;
+ //but for a branch node it may contain several entries so if the nodes children are from different groups it
+ //would have at least two entries pgroup["groupnameOfLeftChild"] = 1, pgroup["groupnameOfRightChild"] = 1.
+ //pCount is the nodes descendant group infomation. i.e. pCount["black"] = 20 would mean that 20 of the nodes
+ //descendant are from group black.
+
+ map<string, int> pGroups; //leaf nodes will only have 1 group, but branch nodes may have multiple groups.
+ map<string, int> pcount;
+
private:
string name;
- vector<string> group;
+ string group;
float branchLength;
int parent;
int lchild;