예제 #1
0
        public void CreatedWithParams_ConstructsOk()
        {
            var dv = DecisionVector.CreateFromItems(continuousSpace,
                                                    exampleContinuousVector[0], exampleContinuousVector[1], exampleContinuousVector[2], exampleContinuousVector[3]);

            for (var i = 0; i < continuousSpace.Count; i++)
            {
                Assert.Equal(dv.ElementAt(i), exampleContinuousVector[i]);
            }
        }
예제 #2
0
        public void GetDiscrete_ReturnsSubsetCorrectly()
        {
            var mixedDecVec = DecisionVector.CreateFromItems(mixedSpace,
                                                             exampleContinuousVector[0], exampleContinuousVector[1],
                                                             exampleContinuousVector[2], exampleContinuousVector[3],
                                                             exampleDiscreteVector[0], exampleDiscreteVector[1],
                                                             exampleDiscreteVector[2], exampleDiscreteVector[3]);

            var continuousSubSet = mixedDecVec.GetDiscreteElements();

            Assert.True(continuousSubSet.Count == Dims);
            Assert.True(continuousSubSet.SequenceEqual(exampleDiscreteVector.Cast <object>()));
        }