internal void LoadStartingKnowledgeBase() { //load knowledge base var ckbSource = AppDomain.CurrentDomain.BaseDirectory; ckbSource = ckbSource.Replace(@"\BioInfo_Terminal\bin\Debug\", ""); ckbSource += @"\SavedKnowlegeBases"; _state.CurrentKBs.Clear(); foreach (var fileName in Directory.GetFiles(ckbSource)) { Ckb = _verbot.AddCompiledKnowledgeBase(fileName); _state.CurrentKBs.Add(fileName); } }
/// <summary> /// Save current knowledge base to a compiled knowledge file *.CKB /// You must call the "LoadKnowledgBase()" function first. /// Remember that you can only compile one * .VKB at a time. /// </summary> /// <param name="path">StreamingAssets/.../....</param> /// <param name="file">Untitled.ckb</param> public void SaveCurrentCompiledKnowledgeBase(string path, string file) { try { string sPath = System.IO.Path.Combine(Application.streamingAssetsPath, path); string pathToSaveFile = System.IO.Path.Combine(sPath, file); CompiledKnowledgeBase ckb = verbot.CompileKnowledgeBase(kb, kbi); verbot.SaveCompiledKnowledgeBase(ckb, pathToSaveFile); Debug.Log(string.Format("{0} file saved in: {1}", file, pathToSaveFile)); } catch (Exception e) { Debug.LogWarning(e.ToString()); } }
internal void AddCkb(string fileName) { Ckb = _verbot.AddCompiledKnowledgeBase(fileName); _state.CurrentKBs.Clear(); _state.CurrentKBs.Add(fileName); }