private NormalDistributionDecisionTree(NormalDistributionDecisionTree tree1, NormalDistributionDecisionTree tree2) { decisions = new List <PercentageDecision>(); foreach (PercentageDecision decision in tree1.decisions) { decisions.Add(decision); } foreach (PercentageDecision decision in tree2.decisions) { PercentageDecision foundDecision = decisions.FirstOrDefault(x => (int)x.DecisionObject == (int)decision.DecisionObject); if (foundDecision != null) { foundDecision.Percentage += decision.Percentage; } else { decisions.Add(decision); } } decisions.ForEach(x => x.Percentage /= 2); //Creates the decision tree decisionTree = new PercentageDecisionTree(); decisionTree.AddDecisions(decisions); }
public static NormalDistributionDecisionTree Merge(NormalDistributionDecisionTree tree1, NormalDistributionDecisionTree tree2) { return(new NormalDistributionDecisionTree(tree1, tree2)); }