Example #1
0
        public WorldObject CreateWalkerObj(World world, Point point, bool isCleaner = false)
        {
            var camera   = _walkerCamera ?? InitializeWalkerCamera(world);
            var behavior = new WanderStrategy(_random)
            {
                ElevateProb   = 0,
                TranslateProb = 0.8,
                RotateProb    = 0.1,
                IsExact       = true
            };
            var model       = isCleaner ? new Cleaner(camera, behavior) : new Walker(camera, behavior);
            int orientation = _random.Next(0, 4) * 90;
            var obj         = new WorldObject(model, Size, point, orientation);

            return(obj);
        }
Example #2
0
        public WorldObject CreateRobotObj(World world, Point point)
        {
            var camera = _robotCamera ?? InitializeRobotCamera(world);
            NavigationSystem nav;
            IStrategy        strategy;

            if (Settings != null)
            {
                nav = new NavigationSystem(world)
                {
                    ElevationStd           = Settings.EstimatedElevationStd,
                    RotationStd            = Settings.EstimatedRotationStd,
                    TranslationStd         = Settings.EstimatedTranslationStd,
                    MeasurementSuccessProb = Settings.EstimatedCameraSuccessProb
                };
                strategy = new WanderStrategy(_random)
                {
                    ElevateProb   = Settings.DecideElevateProb,
                    TranslateProb = Settings.DecideTranslateProb,
                    RotateProb    = Settings.DecideRotateProb,
                    IsExact       = false,
                    Settings      = Settings
                };
            }
            else
            {
                nav      = new NavigationSystem(world);
                strategy = new WanderStrategy(_random)
                {
                    IsExact = false
                };
            }
            var model       = new Robot(camera, nav, strategy);
            int orientation = _random.Next(0, 4) * 90;
            var obj         = new WorldObject(model, Size, point, orientation);

            return(obj);
        }