/// <summary> /// Save facts of the current working memory. Current implications, facts and queries /// remain unchanged. /// </summary> /// <remarks> /// The adapter will be disposed at the end of the method's execution. /// </remarks> /// <param name="adapter">The Adapter used to save the fact base.</param> public void SaveFacts(IFactBaseAdapter adapter) { CheckInitialized(); if (Logger.IsInferenceEngineInformation) Logger.InferenceEngineSource.TraceEvent(TraceEventType.Information, 0, "NxBRE Inference Engine Facts Saving Started, using adapter " + adapter.GetType().FullName); using(adapter) { // header adapter.Direction = Direction; adapter.Label = Label; // facts IList<Fact> facts = new List<Fact>(); foreach(Fact fact in WM.FB) facts.Add(fact); adapter.Facts = facts; } //end: using adapter if (Logger.IsInferenceEngineInformation) Logger.InferenceEngineSource.TraceEvent(TraceEventType.Information, 0, "NxBRE Inference Engine Facts Saving Finished"); }
/// <summary> /// Load facts in the current working memory. Current implications, facts and queries /// remain unchanged. /// </summary> /// <remarks> /// The adapter will be disposed at the end of the method's execution. /// </remarks> /// <param name="adapter">The Adapter used to read the fact base.</param> public void LoadFacts(IFactBaseAdapter adapter) { CheckInitialized(); if (Logger.IsInferenceEngineInformation) Logger.InferenceEngineSource.TraceEvent(TraceEventType.Information, 0, "NxBRE Inference Engine Facts Loading Started, using adapter " + adapter.GetType().FullName); using(adapter) { // sets the eventual Binder if (Binder != null) adapter.Binder = Binder; // load facts int initialFactsCount = WM.FB.Count; foreach(Fact fact in adapter.Facts) Assert(fact); if (Logger.IsInferenceEngineVerbose) Logger.InferenceEngineSource.TraceEvent(TraceEventType.Verbose, 0, "Added " + (WM.FB.Count - initialFactsCount) + " new Facts"); } //end: using adapter if (Logger.IsInferenceEngineInformation) Logger.InferenceEngineSource.TraceEvent(TraceEventType.Information, 0, "NxBRE Inference Engine Facts Loading Finished"); }
/// <summary> /// Save facts of the current working memory. Current implications, facts and queries /// remain unchanged. /// </summary> /// <remarks> /// The adapter will be disposed at the end of the method's execution. /// </remarks> /// <param name="adapter">The Adapter used to save the fact base.</param> public void SaveFacts(IFactBaseAdapter adapter) { CheckInitialized(); if (HasLogListener) ForceDispatchLog("NxBRE Inference Engine Facts Saving Started, using adapter " + adapter.GetType().FullName, LogEventImpl.INFO); using(adapter) { // header adapter.Direction = Direction; adapter.Label = Label; // facts ArrayList facts = new ArrayList(); foreach(Fact fact in WM.FB) facts.Add(fact); adapter.Facts = facts; } //end: using adapter if (HasLogListener) ForceDispatchLog("NxBRE Inference Engine Facts Saving Finished", LogEventImpl.INFO); }
/// <summary> /// Load facts in the current working memory. Current implications, facts and queries /// remain unchanged. /// </summary> /// <remarks> /// The adapter will be disposed at the end of the method's execution. /// </remarks> /// <param name="adapter">The Adapter used to read the fact base.</param> public void LoadFacts(IFactBaseAdapter adapter) { CheckInitialized(); if (HasLogListener) ForceDispatchLog("NxBRE Inference Engine Facts Loading Started, using adapter " + adapter.GetType().FullName, LogEventImpl.INFO); using(adapter) { // sets the eventual Binder if (Binder != null) adapter.Binder = Binder; // load facts int initialFactsCount = WM.FB.Count; foreach(Fact fact in adapter.Facts) Assert(fact); if (HasLogListener) ForceDispatchLog("Added " + (WM.FB.Count - initialFactsCount) + " new Facts", LogEventImpl.DEBUG); } //end: using adapter if (HasLogListener) ForceDispatchLog("NxBRE Inference Engine Facts Loading Finished", LogEventImpl.INFO); }
/// <summary> /// Save facts of the current working memory. Current implications, facts and queries /// remain unchanged. /// </summary> /// <remarks> /// The adapter will be disposed at the end of the method's execution. /// </remarks> /// <param name="adapter">The Adapter used to save the fact base.</param> public void SaveFacts(IFactBaseAdapter adapter) { CheckInitialized(); if (HasLogListener) { ForceDispatchLog("NxBRE Inference Engine Facts Saving Started, using adapter " + adapter.GetType().FullName, LogEventImpl.INFO); } using (adapter) { // header adapter.Direction = Direction; adapter.Label = Label; // facts ArrayList facts = new ArrayList(); foreach (Fact fact in WM.FB) { facts.Add(fact); } adapter.Facts = facts; } //end: using adapter if (HasLogListener) { ForceDispatchLog("NxBRE Inference Engine Facts Saving Finished", LogEventImpl.INFO); } }
/// <summary> /// Load facts in the current working memory. Current implications, facts and queries /// remain unchanged. /// </summary> /// <remarks> /// The adapter will be disposed at the end of the method's execution. /// </remarks> /// <param name="adapter">The Adapter used to read the fact base.</param> public void LoadFacts(IFactBaseAdapter adapter) { CheckInitialized(); if (HasLogListener) { ForceDispatchLog("NxBRE Inference Engine Facts Loading Started, using adapter " + adapter.GetType().FullName, LogEventImpl.INFO); } using (adapter) { // sets the eventual Binder if (Binder != null) { adapter.Binder = Binder; } // load facts int initialFactsCount = WM.FB.Count; foreach (Fact fact in adapter.Facts) { Assert(fact); } if (HasLogListener) { ForceDispatchLog("Added " + (WM.FB.Count - initialFactsCount) + " new Facts", LogEventImpl.DEBUG); } } //end: using adapter if (HasLogListener) { ForceDispatchLog("NxBRE Inference Engine Facts Loading Finished", LogEventImpl.INFO); } }