2011-09-06 225 views
-2

命名空間錯誤找不到哪一個?命名空間錯誤

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); 
} 
} 

Network,SmileException和color都有命名空間錯誤嗎?

+0

顏色將在System.Drawing毫無疑問,至於SmileException,不知道這是什麼,聽起來自定義。 – Lloyd

+0

是Network和SmileException自定義類嗎? –

+0

命名空間錯誤如何不是一個荒謬的問題。停止燃燒!投票重新開放給那些新的機器學習,並沒有下文提到的圖書館。 –

回答

2

這是來自結構建模,推理和學習引擎(SMILE),特別是SMILE.NET。

http://genie.sis.pitt.edu/wiki/JSMILE_and_Smile.NET

...教,不阻燃...

+0

hey ricky thats correct is smile.net已經與Visual Studio 2010捆綁在一起,還是我必須下載它? –

+1

你可以從http://genie.sis.pitt.edu/ – rickythefox

+0

得到圖書館感謝人非常感謝 –

0

那麼,在命名空間是NetworkSmileException界定?
轉至類定義,並檢查命名空間...

Color是無論是在命名空間System.Windows.MediaSystem.Drawing。它取決於Network-類中方法的參數。