Exemple #1
0
		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.");
		}
Exemple #2
0
 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.");
     }
 }
Exemple #3
0
        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.");
            }
        }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 /// <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;
 }
Exemple #6
0
 /// <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;
 }
Exemple #7
0
 /// <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);
 }