本文整理汇总了C#中Domain.GetNodeByName方法的典型用法代码示例。如果您正苦于以下问题:C# Domain.GetNodeByName方法的具体用法?C# Domain.GetNodeByName怎么用?C# Domain.GetNodeByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain.GetNodeByName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBactermiaProbability
/// <summary>
/// Returns the probability of bacterimia in a patient
/// </summary>
/// <param name="dom">The Cpn network domain</param>
/// <returns>The probability of bacterimia</returns>
public float GetBactermiaProbability(Domain dom)
{
//Find bacteremia nodes in CPN
DiscreteChanceNode dSepsisNode = (DiscreteChanceNode)dom.GetNodeByName("Bacteremia_total");
DiscreteChanceNode dSepsisNode1 = (DiscreteChanceNode)dom.GetNodeByName("Bacteremia_total_1");
DiscreteChanceNode dSepsisNode2 = (DiscreteChanceNode)dom.GetNodeByName("Bacteremia_total_2");
List<float> results = new List<float>();
results.Add(dSepsisNode.GetBelief((uint)1));
results.Add(dSepsisNode1.GetBelief((uint)1));
results.Add(dSepsisNode2.GetBelief((uint)1));
float finalResult = 0f;
foreach (float res in results)
{
if (res > finalResult)
{
finalResult = res;
}
}
return finalResult;
}
示例2: GetBeliefsOnSepsisNode
public SepsisResult GetBeliefsOnSepsisNode(Domain dom)
{
SepsisResult result = new SepsisResult();
//Find sepsis node in CPN
DiscreteChanceNode dSepsisNode = (DiscreteChanceNode)dom.GetNodeByName("Sepsis_pu_em_gg_us_pn");
//Read all states on sepsis node
result.No = dSepsisNode.GetBelief((uint)0);
result.Mild = dSepsisNode.GetBelief((uint)1);
result.Moderate = dSepsisNode.GetBelief((uint)2);
result.Severe = dSepsisNode.GetBelief((uint)3);
result.Critical = dSepsisNode.GetBelief((uint)4);
result.Bacterimia = GetBactermiaProbability(dom);
dom.RetractFindings();
return result;
}
示例3: DiscreteRangeNodeInitializeStatesAge
/// <summary>
/// Special case for age. Initializes age
/// </summary>
/// <param name="nodeID"></param>
/// <param name="age"></param>
/// <param name="dNode"></param>
/// <param name="lookupList"></param>
public void DiscreteRangeNodeInitializeStatesAge(int age, Domain dom, List<aDiscreteNodeRange> lookupList)
{
//Find the discrete node "age" in CPN
DiscreteChanceNode dNode = (DiscreteChanceNode)dom.GetNodeByName("age");
string nodeID = "age";
//Find state to initialize
string nodeState = GetStateToInitDNodeRange(nodeID, age, lookupList);
//If value is null, don't initialize anything on the current node
if (nodeState == null)
{
throw new Exception();
}
//Enter findings (evidence) in discrete node
DiscreteNodeEnterFindings(dNode, nodeState);
}