public override void CommitIsolated() { if (Type == WorkingMemoryTypes.Isolated) { globalFactBase = workingFactBase; Type = WorkingMemoryTypes.Global; } else if (Type == WorkingMemoryTypes.IsolatedEmpty) { foreach(Fact f in workingFactBase) globalFactBase.Assert(f); Type = WorkingMemoryTypes.Global; } else throw new BREException("Current Working Memory is not Isolated and can not be committed."); }
public override void CommitIsolated() { if (Type == WorkingMemoryTypes.Isolated) { globalFactBase = WorkingFactBase; Type = WorkingMemoryTypes.Global; } else if (Type == WorkingMemoryTypes.IsolatedEmpty) { foreach (Fact f in WorkingFactBase) { globalFactBase.Assert(f); } Type = WorkingMemoryTypes.Global; } else { throw new BREException("Current Working Memory is not Isolated and can not be committed."); } }
public override void CommitIsolated() { switch (Type) { case WorkingMemoryTypes.Isolated: globalFactBase = WorkingFactBase; Type = WorkingMemoryTypes.Global; break; case WorkingMemoryTypes.IsolatedEmpty: foreach (Fact f in WorkingFactBase) { globalFactBase.Assert(f); } Type = WorkingMemoryTypes.Global; break; case WorkingMemoryTypes.Global: break; default: throw new BREException("Current Working Memory is not Isolated and can not be committed."); } }
/// <summary> /// Sets the WorkingMemory of the engine, either by forking the existing Global memory /// to a new Isolated one, or by simply using the Global one. /// </summary> /// <param name="memoryType">The new type of working memory.</param> public void NewWorkingMemory(WorkingMemoryTypes memoryType) { IE.NewWorkingMemory(memoryType); }
/// <summary> /// Sets the WorkingMemory of the engine, either by forking the existing Global memory /// to a new Isolated one, or by simply using the Global one. /// </summary> /// <param name="memoryType">The new type of working memory.</param> public void NewWorkingMemory(WorkingMemoryTypes memoryType) { CheckInitialized(); WM.Type = memoryType; }
/// <summary> /// Sets the WorkingMemory of the engine, either by forking the existing Global memory /// to a new Isolated one, or by simply using the Global one. /// </summary> /// <param name="memoryType">The new type of working memory.</param> public void NewWorkingMemory(WorkingMemoryTypes memoryType) { CheckInitialized(); WM.Type = memoryType; }
/// <summary> /// Sets the WorkingMemory of the engine, either by forking the existing Global memory /// to a new Isolated one, or by simply using the Global one. /// </summary> /// <param name="memoryType">The new type of working memory.</param> public void NewWorkingMemory(WorkingMemoryTypes memoryType) { IE.NewWorkingMemory(memoryType); }