Пример #1
0
        internal void Initialize(
            LearningRule rule, 
            ValueSpace<double> valueSpace,
            InputValueIndexes[] inputValueIndexes,
            OutputValueIndexes[] outputValueIndexes)
        {
            Contract.Requires(rule != null);
            Contract.Requires(valueSpace != null);
            Contract.Requires(inputValueIndexes != null);
            Contract.Requires(outputValueIndexes != null);
            Contract.Requires(inputValueIndexes.Length == outputValueIndexes.Length);

            Rule = rule;
            ValueSpace = valueSpace;
            this.inputValueIndexes = inputValueIndexes;
            this.outputValueIndexes = outputValueIndexes;
            ValueCount = inputValueIndexes.Length;

            InitializeNewRun(true);
        }
Пример #2
0
        unsafe public void SetTest(int count, int testValue)
        {
            PexAssume.IsTrue(count > 0 && count < 100);

            using (var space = new ValueSpace<int>(Guid.NewGuid()))
            {
                var indexes = space.Declare(count);

                space.Close();

                foreach (int index in indexes)
                {
                    space[index] = testValue;
                }

                foreach (int index in indexes)
                {
                    PexAssert.IsTrue(space[index] == testValue);
                }
            }
        }