public MainWindow() { InitializeComponent(); knowlegeBase = (LoadKnowlegeBaseFromFile()); knowlegeBaseManager = new KnowlegeBaseManager(knowlegeBase); editNodeWindow = new EditNodeWindow(this, knowlegeBaseManager); inferenceEngine = new InferenceEngine(knowlegeBaseManager); }
static public void Serialize(KnowlegeBase kb) { XmlSerializer formatter = new XmlSerializer(typeof(KnowlegeBase)); using (FileStream fs = new FileStream(rulesFilePath, FileMode.Create)) { formatter.Serialize(fs, kb); } }
static public KnowlegeBase Deserialize() { KnowlegeBase result = null; XmlSerializer formatter = new XmlSerializer(typeof(KnowlegeBase)); using (FileStream fs = new FileStream(rulesFilePath, FileMode.OpenOrCreate)) { result = (KnowlegeBase)formatter.Deserialize(fs); } return(result); }
/// <summary> /// Конструктор для KnowlegeBaseManager /// </summary> /// <param name="kb">Входные данные KnowlegeBase</param> public KnowlegeBaseManager(KnowlegeBase kb) { Base = kb; }