public static DistributionDiscrete GetInstance(string distributionAndLeafName) { if (distributionAndLeafName.StartsWith("Conditional")) { return(DistributionDiscreteConditional.GetInstance(distributionAndLeafName.Substring("Conditional".Length))); } else if (distributionAndLeafName.StartsWith("Joint")) { return(DistributionDiscreteJointUndirected.GetInstance(distributionAndLeafName.Substring("Joint".Length))); } throw new ArgumentException("Cannot parse DistributionDiscrete name " + distributionAndLeafName); }
new public static DistributionDiscreteJoint GetInstance(string jointDistnType) { SpecialFunctions.CheckCondition(false, "Joint distributions not supported because need code/libraries for matrix operations."); switch (jointDistnType.ToLower()) { case "undirected": return(DistributionDiscreteJointUndirected.GetInstance()); case "directed": return(DistributionDiscreteJointDirected.GetInstance()); default: throw new ArgumentException("Unknown joint distribution type: " + jointDistnType); } }