コード例 #1
0
        public void TestTauFirst()
        {
            var tauFirstTests = new TauFirstTestConfiguration[]
            {
                // No exploration
                new TauFirstTestConfiguration
                {
                    AppId                  = TestContext.TestName + "NoExplorationFixedActionContext",
                    ContextType            = ContextType.FixedAction, // test fixed-action context
                    Tau                    = 0,
                    NumberOfActions        = 20,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    PolicyConfiguration    = new FixedPolicyConfiguration {
                        Action = 10
                    }
                },
                new TauFirstTestConfiguration
                {
                    AppId                  = TestContext.TestName + "NoExplorationVariableActionContext",
                    ContextType            = ContextType.VariableAction, // test variable-action context
                    Tau                    = 5,
                    NumberOfActions        = 20,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    PolicyConfiguration    = new FixedPolicyConfiguration {
                        Action = 10
                    }
                },

                // Heavy exploration
                new TauFirstTestConfiguration
                {
                    AppId                  = TestContext.TestName + "HeavyExplorationFixedActionContext",
                    ContextType            = ContextType.FixedAction,
                    Tau                    = 100,
                    NumberOfActions        = 10,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    PolicyConfiguration    = new FixedPolicyConfiguration {
                        Action = 9
                    }
                },
                new TauFirstTestConfiguration
                {
                    AppId                  = TestContext.TestName + "HeavyExplorationVariableActionContext",
                    ContextType            = ContextType.VariableAction,
                    Tau                    = 100,
                    NumberOfActions        = 10,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    PolicyConfiguration    = new FixedPolicyConfiguration {
                        Action = 9
                    }
                }
            };

            Run(outputFilePatternExpected, outputFilePatternActual, outputJsonConfigFile, tauFirstTests);

            for (uint i = 0; i < tauFirstTests.Length; i++)
            {
                CompareExplorationData(FormatPath(outputFilePatternExpected, i), FormatPath(outputFilePatternActual, i));
            }
        }
コード例 #2
0
        public void TestTauFirst()
        {
            var tauFirstTests = new TauFirstTestConfiguration[]
            {
                // No exploration
                new TauFirstTestConfiguration
                {
                    AppId = TestContext.TestName + "NoExplorationFixedActionContext",
                    ContextType = ContextType.FixedAction, // test fixed-action context
                    Tau = 0,
                    NumberOfActions = 20,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    PolicyConfiguration = new FixedPolicyConfiguration { Action = 10 }
                },
                new TauFirstTestConfiguration
                {
                    AppId = TestContext.TestName + "NoExplorationVariableActionContext",
                    ContextType = ContextType.VariableAction, // test variable-action context
                    Tau = 5,
                    NumberOfActions = 20,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    PolicyConfiguration = new FixedPolicyConfiguration { Action = 10 }
                },

                // Heavy exploration
                new TauFirstTestConfiguration
                {
                    AppId = TestContext.TestName + "HeavyExplorationFixedActionContext",
                    ContextType = ContextType.FixedAction,
                    Tau = 100,
                    NumberOfActions = 10,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    PolicyConfiguration = new FixedPolicyConfiguration { Action = 9 }
                },
                new TauFirstTestConfiguration
                {
                    AppId = TestContext.TestName + "HeavyExplorationVariableActionContext",
                    ContextType = ContextType.VariableAction,
                    Tau = 100,
                    NumberOfActions = 10,
                    ExperimentalUnitIdList = Enumerable.Range(1, 100).Select(i => i.ToString()).ToList(),
                    PolicyConfiguration = new FixedPolicyConfiguration { Action = 9 }
                }
            };

            Run(outputFilePatternExpected, outputFilePatternActual, outputJsonConfigFile, tauFirstTests);

            for (uint i = 0; i < tauFirstTests.Length; i++)
            {
                CompareExplorationData(FormatPath(outputFilePatternExpected, i), FormatPath(outputFilePatternActual, i));
            }
        }