Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 名称空间错误_C# - Fatal编程技术网

C# 名称空间错误

C# 名称空间错误,c#,C#,名称空间错误找不到哪一个 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { public void CreateNetwork() { try { Network net = new Network(); // Creating node "Su

名称空间错误找不到哪一个

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
 public void CreateNetwork() {
 try {
   Network net = new Network();

   // Creating node "Success" and setting/adding outcomes:
   net.AddNode(Network.NodeType.Cpt, "Success");
   net.SetOutcomeId("Success", 0, "Success");
   net.SetOutcomeId("Success", 1, "Failure");

   // Creating node "Forecast" and setting/adding outcomes:
   net.AddNode(Network.NodeType.Cpt, "Forecast");
   net.AddOutcome("Forecast", "Good");
   net.AddOutcome("Forecast", "Moderate");
   net.AddOutcome("Forecast", "Poor");
   net.DeleteOutcome("Forecast", 0);
   net.DeleteOutcome("Forecast", 0);

   // Adding an arc from "Success" to "Forecast":
   net.AddArc("Success", "Forecast");

   // Filling in the conditional distribution for node "Success". The 
   // probabilities are:
   // P("Success" = Success) = 0.2
   // P("Success" = Failure) = 0.8
   double[] aSuccessDef = {0.2, 0.8}; 
   net.SetNodeDefinition("Success", aSuccessDef);

   // Filling in the conditional distribution for node "Forecast". The 
   // probabilities are:
   // P("Forecast" = Good | "Success" = Success) = 0.4
   // P("Forecast" = Moderate | "Success" = Success) = 0.4
   // P("Forecast" = Poor | "Success" = Success) = 0.2
   // P("Forecast" = Good | "Success" = Failure) = 0.1
   // P("Forecast" = Moderate | "Success" = Failure) = 0.3
   // P("Forecast" = Poor | "Success" = Failure) = 0.6
   double[] aForecastDef = {0.4, 0.4, 0.2, 0.1, 0.3, 0.6}; 
   net.SetNodeDefinition("Forecast", aForecastDef);

   // Changing the nodes' spacial and visual attributes:
   net.SetNodePosition("Success", 20, 20, 100, 50);
   net.SetNodeBgColor("Success", Color.Tomato);
   net.SetNodeTextColor("Success", Color.White);
   net.SetNodeBorderColor("Success", Color.Black);
   net.SetNodeBorderWidth("Success", 2);
   net.SetNodePosition("Forecast", 30, 100, 90, 130);

   // Writting the network to a file:
   net.WriteFile("tutorial_a.xdsl");
 }
 catch (SmileException e) {
   Console.WriteLine(e.Message);
 }
}

网络、SmileException和color都有名称空间错误?

这是来自结构建模、推理和学习引擎(SMILE),特别是SMILE.NET


。。。教学,而不是火焰…

好吧,在哪个名称空间中定义了
网络
SmileException

转到类定义并检查命名空间


Color
位于命名空间
System.Windows.Media
System.Drawing
中。这取决于
网络
-类中方法的参数。

颜色将在系统中。毫无疑问,对于SmileException,不知道它在哪里,听起来是自定义的。网络和SmileException是自定义类吗?名称空间错误如何不是一个可笑的问题。停止燃烧!投票为那些新加入机器学习且没有以下提到的库的人重新开放。嘿,ricky,这是正确的,是微笑.net已经与visual studio 2010捆绑在一起了还是我必须下载它?你可以从