コード例 #1
0
ファイル: Randomizer.cs プロジェクト: SimonRichards/msUnit
        /// <summary>
        /// Get a randomizer for a particular member, returning
        /// one that has already been created if it exists.
        /// This ensures that the same values are generated
        /// each time the tests are reloaded.
        /// </summary>
        public static Randomizer GetRandomizer(MemberInfo member)
        {
            Randomizer r = (Randomizer)randomizers[member];

            if ( r == null )
                randomizers[member] = r = new Randomizer();

            return r;
        }
コード例 #2
0
        public void setUp()
        {
            rainman = HMMFactory.createRainmanHMM();
            robot = HMMFactory.createRobotHMM();

            randomizer = new MockRandomizer(new double[] { 0.1, 0.9 });
            particleSet = new ParticleSet(rainman);
            particleSet.add(new Particle(HmmConstants.RAINING));
            particleSet.add(new Particle(HmmConstants.RAINING));
            particleSet.add(new Particle(HmmConstants.RAINING));
            particleSet.add(new Particle(HmmConstants.NOT_RAINING));
        }