本文整理汇总了C#中Domain.Compile方法的典型用法代码示例。如果您正苦于以下问题:C# Domain.Compile方法的具体用法?C# Domain.Compile怎么用?C# Domain.Compile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain.Compile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDiscreteNodeEnterFindings
public void TestDiscreteNodeEnterFindings()
{
Console.Out.WriteLine("Test enter finding into discrete node called");
Domain dom = new Domain();
//Create new test discrete chance node
DiscreteChanceNode dNode = new NumberedDCNode(dom);
uint noOfStates = 4; //The number of states to create
dNode.SetNumberOfStates(noOfStates);
int i = 0;
while (i < noOfStates)
{
dNode.SetStateLabel((uint)i, string.Format("state{0}", i));
i++;
}
string nodeState = "state2"; //Node state that should be initialized to 100 %
testSepsisController.DiscreteNodeEnterFindings(dNode, nodeState);
dom.Compile(); //Compile CPN so it's possible to read belief for each state on Discrete node
Assert.AreEqual(0f, dNode.GetBelief(0), "The state0 on the discrete chance node should read 0 % (0f)");
Assert.AreEqual(0f, dNode.GetBelief(1), "The state1 on the discrete chance node should read 0 % (0f)");
Assert.AreEqual(1.0f, dNode.GetBelief(2), "The state2 on the discrete chance node should read 100 % (1.0f)");
Assert.AreEqual(0f, dNode.GetBelief(3), "The state3 on the discrete chance node should read 0 % (0f)");
}