Ejemplo n.º 1
0
        public void Search_space_remove_option_test()
        {
            var option = new BasicSearchSpace();
            var ss     = new SearchSpace <BasicSearchSpace>(option);

            ss.FeatureSpaceDim.Should().Be(6);

            ss.Remove("UniformInt").Should().BeTrue();
            ss.FeatureSpaceDim.Should().Be(5);
            ss.Keys.Should().BeEquivalentTo("ChoiceStr", "UniformDouble", "UniformFloat", "ChoiceBoolean", "JTokenType");

            var parameter = ss.SampleFromFeatureSpace(new double[] { 0, 0, 0, 0, 0 });

            parameter.DefaultSearchSpace.Strings.Should().BeEquivalentTo("A", "B", "C");
            parameter.DefaultSearchSpace.String.Should().BeNullOrEmpty();
            parameter.ChoiceStr.Should().Be("a");
            parameter.ChoiceBoolean.Should().BeFalse();
            parameter.JTokenType.Should().Be(JsonTokenType.EndObject);
        }