public _IRunnable_23(DynamicVariableTestCase _enclosing, DynamicVariable variable
                      , Collection4 failures)
 {
     this._enclosing = _enclosing;
     this.variable   = variable;
     this.failures   = failures;
 }
 /// <summary>
 /// Adds the variable to the dynamic evaluation context.
 /// </summary>
 /// <param name="name">The name of the variable to add to the context.</param>
 /// <param name="value">The value of the variable to add to the context.</param>
 /// <remarks>
 /// Value type conversion for XPath evaluation is as follows:
 /// <list type="table">
 ///		<listheader>
 ///			<term>CLR Type</term>
 ///			<description>XPath type</description>
 ///		</listheader>
 ///		<item>
 ///			<term>System.String</term>
 ///			<description>XPathResultType.String</description>
 ///		</item>
 ///		<item>
 ///			<term>System.Double (or types that can be converted to)</term>
 ///			<description>XPathResultType.Number</description>
 ///		</item>
 ///		<item>
 ///			<term>System.Boolean</term>
 ///			<description>XPathResultType.Boolean</description>
 ///		</item>
 ///		<item>
 ///			<term>System.Xml.XPath.XPathNavigator</term>
 ///			<description>XPathResultType.Navigator</description>
 ///		</item>
 ///		<item>
 ///			<term>System.Xml.XPath.XPathNodeIterator</term>
 ///			<description>XPathResultType.NodeSet</description>
 ///		</item>
 ///		<item>
 ///			<term>Others</term>
 ///			<description>XPathResultType.Any</description>
 ///		</item>
 /// </list>
 /// <note type="note">See the topic "Compile, Select, Evaluate, and Matches with
 /// XPath and XPathExpressions" in MSDN documentation for additional information.</note>
 /// </remarks>
 /// <exception cref="ArgumentNullException">The <paramref name="value"/> is null.</exception>
 public void AddVariable(string name, object value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value");
     }
     _variables[name] = new DynamicVariable(name, value);
 }
        public virtual void TestMultiThread()
        {
            DynamicVariable variable = new DynamicVariable();
            Collection4     failures = new Collection4();

            variable.With("mine", new _IRunnable_23(this, variable, failures));
            Assert.IsNull(variable.Value);
            Assert.IsTrue(failures.IsEmpty(), failures.ToString());
        }
Beispiel #4
0
        public override void Dispose()
        {
            if (_TargetNetwork!=null)_TargetNetwork.Dispose();
            _DynamicLearningRate = null;
            _DynamicMomentum = null;
            if (_LoopThread != null) _LoopThread.Abort();

            base.Dispose();
        }
 private Thread[] CreateThreads(DynamicVariable variable, Collection4 failures)
 {
     Thread[] threads = new Thread[5];
     for (int i = 0; i < threads.Length; i++)
     {
         threads[i] = new Thread(new _IRunnable_56(this, variable, failures), "DynamicVariableTestCase.checkVariableBehavior Thread["
                                 + i + "]");
     }
     return(threads);
 }
Beispiel #6
0
 protected Base(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _CurrentEpoch = info.GetInt32("_CurrentEpoch");
     _DynamicLearningRate = (DynamicVariable) info.GetValue("_DynamicLearningRate", typeof (DynamicVariable));
     _DynamicMomentum = (DynamicVariable) info.GetValue("_DynamicMomentum", typeof (DynamicVariable));
     _MaxEpochs = info.GetInt32("_MaxEpochs");
     _TargetNetwork = (Network) info.GetValue("_TargetNetwork", typeof (Network));
     _WorkingDataset = (Double[][]) info.GetValue("_WorkingDataset", typeof (Double[][]));
 }
Beispiel #7
0
 public BooCodeBuilder()
 {
     _typeReferenceFactory = new DynamicVariable<ITypeReferenceFactory>(new StandardTypeReferenceFactory(this));
 }
        public virtual void TestSingleThread()
        {
            DynamicVariable variable = new DynamicVariable();

            CheckVariableBehavior(variable);
        }
 public _IRunnable_78(DynamicVariable variable)
 {
     this.variable = variable;
 }
 private void CheckVariableBehavior(DynamicVariable variable)
 {
     Assert.IsNull(variable.Value);
     variable.With("foo", new _IRunnable_75(variable));
     Assert.IsNull(variable.Value);
 }
Beispiel #11
0
 public BooCodeBuilder()
 {
     _typeReferenceFactory = new DynamicVariable <ITypeReferenceFactory>(new StandardTypeReferenceFactory(this));
 }
Beispiel #12
0
 private static DynamicVariable<CompilerContext> CurrentVariable()
 {
     if (null == _current) _current = new DynamicVariable<CompilerContext>();
     return _current;
 }
		/// <summary>
		/// Adds the variable to the dynamic evaluation context.
		/// </summary>
		/// <param name="name">The name of the variable to add to the context.</param>
		/// <param name="value">The value of the variable to add to the context.</param>
		/// <remarks>
		/// Value type conversion for XPath evaluation is as follows:
		/// <list type="table">
		///		<listheader>
		///			<term>CLR Type</term>
		///			<description>XPath type</description>
		///		</listheader>
		///		<item>
		///			<term>System.String</term>
		///			<description>XPathResultType.String</description>
		///		</item>
		///		<item>
		///			<term>System.Double (or types that can be converted to)</term>
		///			<description>XPathResultType.Number</description>
		///		</item>
		///		<item>
		///			<term>System.Boolean</term>
		///			<description>XPathResultType.Boolean</description>
		///		</item>
		///		<item>
		///			<term>System.Xml.XPath.XPathNavigator</term>
		///			<description>XPathResultType.Navigator</description>
		///		</item>
		///		<item>
		///			<term>System.Xml.XPath.XPathNodeIterator</term>
		///			<description>XPathResultType.NodeSet</description>
		///		</item>
		///		<item>
		///			<term>Others</term>
		///			<description>XPathResultType.Any</description>
		///		</item>
		/// </list>
		/// <note type="note">See the topic "Compile, Select, Evaluate, and Matches with 
		/// XPath and XPathExpressions" in MSDN documentation for additional information.</note>
		/// </remarks>
		/// <exception cref="ArgumentNullException">The <paramref name="value"/> is null.</exception>
		public void AddVariable(string name, object value)
		{
			if (value == null) throw new ArgumentNullException("value");
			_variables[name] = new DynamicVariable(name, value);
		}
Beispiel #14
0
 /// <summary>
 ///     Sets the dynamic momenum delegate passing null will switch back to static momentum.
 /// </summary>
 /// <param name='function'>
 ///     Function.
 /// </param>
 public virtual void SetDynamicMomenumDelegate(DynamicVariable function)
 {
     _DynamicMomentum = function;
 }
Beispiel #15
0
 /// <summary>
 ///     Sets the dynamic learning rate delegate, passing null will switch back to static learning rate.
 /// </summary>
 /// <param name='function'>
 ///     Function.
 /// </param>
 public virtual void SetDynamicLearningRateDelegate(DynamicVariable function)
 {
     _DynamicLearningRate = function;
 }