public static IWorkingMemory NewWorkingMemory(ThreadingModelTypes threadingModelType, int lockTimeOut) { if (threadingModelType == ThreadingModelTypes.Single) return new WorkingMemory(); else if (threadingModelType == ThreadingModelTypes.Multi) return new ThreadSafeWorkingMemory(false, lockTimeOut); else if (threadingModelType == ThreadingModelTypes.MultiHotSwap) return new ThreadSafeWorkingMemory(true, lockTimeOut); else throw new BREException("Unsupported threading model type: " + threadingModelType); }
/// <summary> /// Instantiates a new Inference Engine with the specified threading model, using a business objects binder for asserting facts and evaluating functions. /// </summary> /// <param name="businessObjectsBinder">The business object binder that the engine must use.</param> /// <param name="threadingModelType">The threading model type that the engine must support.</param> public IEImpl(IBinder businessObjectsBinder, ThreadingModelTypes threadingModelType) { initialized = false; // instantiate a new working memory wm = WorkingMemoryFactory.NewWorkingMemory(threadingModelType); // set the binder Binder = businessObjectsBinder; }
public static IWorkingMemory NewWorkingMemory(ThreadingModelTypes threadingModelType, int lockTimeOut) { switch (threadingModelType) { case ThreadingModelTypes.Single: return(new WorkingMemory()); case ThreadingModelTypes.Multi: return(new ThreadSafeWorkingMemory(false, lockTimeOut)); case ThreadingModelTypes.MultiHotSwap: return(new ThreadSafeWorkingMemory(true, lockTimeOut)); default: throw new BREException("Unsupported threading model type: " + threadingModelType); } }
public static IWorkingMemory NewWorkingMemory(ThreadingModelTypes threadingModelType) { if (threadingModelType == ThreadingModelTypes.Single) { return(new WorkingMemory()); } else if (threadingModelType == ThreadingModelTypes.Multi) { return(new ThreadSafeWorkingMemory(false)); } else if (threadingModelType == ThreadingModelTypes.MultiHotSwap) { return(new ThreadSafeWorkingMemory(true)); } else { throw new BREException("Unsupported threading model type: " + threadingModelType); } }
/// <summary> /// Instantiates a new Inference Engine with the specified threading model, using a business objects binder for asserting facts and evaluating functions. /// </summary> /// <param name="businessObjectsBinder">The business object binder that the engine must use.</param> /// <param name="threadingModelType">The threading model type that the engine must support.</param> public IEImpl(IBinder businessObjectsBinder, ThreadingModelTypes threadingModelType) { initialized = false; // instantiate a new working memory wm = WorkingMemoryFactory.NewWorkingMemory(threadingModelType, lockTimeOut); // set the binder Binder = businessObjectsBinder; }
/// <summary> /// Instantiates a new Inference Engine with the specified threading model. /// </summary> /// <param name="threadingModelType">The threading model type that the engine must support.</param> public IEImpl(ThreadingModelTypes threadingModelType) : this(null, threadingModelType) { }