Esempio n. 1
0
        public void Setup()
        {
            FieldSize fieldsize = new FieldSize
            {
                Xmax = 4,
                Ymax = 3,
                Xmin = 0,
                Ymin = 0,
                Zmax = 4,
                Zmin = -4
            };

            this.filter = new PositionParticleFilter(
                new RandomNoiseGenerator(new ContinuousUniform()),
                0.1f,
                new MultinomialResampler(),
                new RandomParticleGenerator(new ContinuousUniform()),
                200,
                fieldsize,
                new MovingAverageSmoother(500));

            this.posdist   = new Normal(0.1);
            this.posnoise  = new MathNet.Numerics.Distributions.Normal(0, 0.1);
            this.possource = new Mock <IPositionSource>();
            this.possource.Setup(foo => foo.GetPositionsClosestTo(It.IsAny <long>(), It.IsAny <long>())).Returns <long, long>((ts, range) => this.Pos(ts));
            this.filter.AddPositionSource(this.possource.Object);

            this.disdist   = new Normal(0.1);
            this.disnoise  = new MathNet.Numerics.Distributions.Normal(0, 0.1);
            this.dissource = new Mock <IDisplacementSource>();
            this.dissource.Setup(foo => foo.GetDisplacement(It.IsAny <long>(), It.IsAny <long>())).Returns <long, long>(this.Dis);
            this.filter.AddDisplacementSource(this.dissource.Object);
        }
Esempio n. 2
0
        public void SetUp()
        {
            this.filter = new OrientationParticleFilter(
                new RandomNoiseGenerator(new ContinuousUniform()),
                0.01f,
                new MultinomialResampler(),
                new RandomParticleGenerator(new ContinuousUniform()),
                200,
                new MovingAverageSmoother(500));

            this.oridist    = new Normal(3);
            this.orinoise   = new MathNet.Numerics.Distributions.Normal(0, 3);
            this.orisource  = new Mock <IOrientationSource>();
            this.orisource2 = new Mock <IOrientationSource>();
            this.orisource.Setup(foo => foo.GetOrientationClosestTo(It.IsAny <long>(), It.IsAny <long>())).Returns <long, long>((ts, range) => this.Ori(ts));
            this.orisource2.Setup(foo => foo.GetOrientationClosestTo(It.IsAny <long>(), It.IsAny <long>())).Returns <long, long>((ts, range) => this.Ori(ts));
            this.filter.AddOrientationSource(this.orisource.Object);
            this.filter.AddOrientationSource(this.orisource2.Object);
        }