예제 #1
0
        protected override void CreateScene()
        {
            Actions = new AvatarsActions(false, false, true, true);

            SizeF size = new SizeF(WrappedWorld.GetPowGeometry().Width / 4, WrappedWorld.GetPowGeometry().Height / 4);

            PointF location = WrappedWorld.RandomPositionInsidePowNonCovering(RndGen, size);

            Shape randomVeryGoodFood = WrappedWorld.CreateRandomVeryGoodFood(location, size, RndGen);

            Actions.Movement = MoveActionsToTarget(randomVeryGoodFood.Center());

            PointF location2 = WrappedWorld.RandomPositionInsidePowNonCovering(RndGen, size);

            if (RndGen.Next(3) > 0)
            {
                Shape randomEnemy = WrappedWorld.CreateRandomEnemy(location2, size, RndGen);
                Actions.Movement = NegateMoveActions(MoveActionsToTarget(randomEnemy.Center()));
            }
            else if (RndGen.Next(3) > 0)
            {
                WrappedWorld.CreateRandomFood(location2, size, RndGen);
            }
            else if (RndGen.Next(3) > 0)
            {
                WrappedWorld.CreateRandomStone(location2, size, RndGen);
            }

            WriteActions();
        }
예제 #2
0
        protected override void CreateScene()
        {
            Actions = new AvatarsActions(false, false, true, true);

            SizeF size = new SizeF(WrappedWorld.GetPowGeometry().Width / 4, WrappedWorld.GetPowGeometry().Height / 4);

            int    positionsWcCount  = Positions.PositionsWithoutCenter.Count;
            int    randomLocationIdx = RndGen.Next(positionsWcCount);
            PointF location          = Positions.PositionsWithoutCenter[randomLocationIdx];

            int    randomLocationIdx2 = (RndGen.Next(positionsWcCount - 1) + randomLocationIdx + 1) % positionsWcCount;
            PointF location2          = Positions.PositionsWithoutCenter[randomLocationIdx2];

            if (RndGen.Next(ScConstants.numShapes + 1) > 0)
            {
                Shape randomFood = WrappedWorld.CreateRandomFood(location, size, RndGen);
                Actions.Movement = MoveActionsToTarget(randomFood.GetCenter());
            }
            if (RndGen.Next(ScConstants.numShapes + 1) > 0)
            {
                WrappedWorld.CreateRandomStone(location2, size, RndGen);
            }

            WriteActions();
        }
예제 #3
0
        protected override void CreateScene()
        {
            Actions = new AvatarsActions(false, false, true, true);

            if (RndGen.Next(9) > 0)
            {
                SizeF size = new SizeF(WrappedWorld.GetPowGeometry().Width / 4, WrappedWorld.GetPowGeometry().Height / 4);

                PointF location = Positions.Center();

                if (LearningTaskHelpers.FlipCoin(RndGen))
                {
                    WrappedWorld.CreateRandomFood(location, size, RndGen);
                    Actions.Eat = true;
                }
                else
                {
                    WrappedWorld.CreateRandomStone(location, size, RndGen);
                }

                if (LearningTaskHelpers.FlipCoin(RndGen))
                {
                    PointF location2 = WrappedWorld.RandomPositionInsidePowNonCovering(RndGen, size);
                    WrappedWorld.CreateRandomStone(location2, size, RndGen);
                }
            }

            WriteActions();
        }
예제 #4
0
        protected override void CreateScene()
        {
            Actions = new AvatarsActions(false, false, true, true);

            SizeF size = new SizeF(WrappedWorld.GetPowGeometry().Width / 4, WrappedWorld.GetPowGeometry().Height / 4);

            int    positionsCount    = Positions.Positions.Count;
            int    randomLocationIdx = RndGen.Next(positionsCount);
            PointF location          = Positions.Positions[randomLocationIdx];

            int    randomLocationIdx2 = (RndGen.Next(positionsCount - 1) + randomLocationIdx + 1) % positionsCount;
            PointF location2          = Positions.Positions[randomLocationIdx2];

            Shape randomEnemy = WrappedWorld.CreateRandomEnemy(location, size, RndGen);

            Actions.Movement = NegateMoveActions(MoveActionsToTarget(randomEnemy.Center()));

            if (LearningTaskHelpers.FlipCoin(RndGen))
            {
                WrappedWorld.CreateRandomFood(location2, size, RndGen);
            }
            else
            {
                WrappedWorld.CreateRandomStone(location2, size, RndGen);
            }

            WriteActions();
        }
예제 #5
0
        protected override void CreateScene()
        {
            Actions = new AvatarsActions(false, false, true, true);

            SizeF size = new SizeF(WrappedWorld.GetPowGeometry().Width / 4, WrappedWorld.GetPowGeometry().Height / 4);

            int       positionsCount    = Positions.Positions.Count;
            const int randomLocationIdx = 4;
            PointF    location          = Positions.Positions[randomLocationIdx];

            int    randomLocationIdx2 = (RndGen.Next(positionsCount - 1) + randomLocationIdx + 1) % positionsCount;
            PointF location2          = Positions.Positions[randomLocationIdx2];

            WrappedWorld.CreateRandomVeryGoodFood(location, size, RndGen);
            Actions.Eat = true;

            if (RndGen.Next(3) > 0)
            {
                Shape randomEnemy = WrappedWorld.CreateRandomEnemy(location2, size, RndGen);
                Actions.Eat      = false;
                Actions.Movement = NegateMoveActions(MoveActionsToTarget(randomEnemy.GetCenter()));
            }
            else if (RndGen.Next(3) > 0)
            {
                WrappedWorld.CreateRandomFood(location2, size, RndGen);
            }
            else if (RndGen.Next(3) > 0)
            {
                WrappedWorld.CreateRandomStone(location2, size, RndGen);
            }

            WriteActions();
        }
예제 #6
0
        protected override void CreateScene()
        {
            Actions = new AvatarsActions(true, false, false, false);

            int randomLocationIdx = RndGen.Next(ScConstants.numPositions);

            if (RndGen.Next(ScConstants.numShapes + 1) > 0)
            {
                AddShape(randomLocationIdx);
                Actions.Shapes[ShapeIndex] = true;
            }


            int nextRandomLocationIdx = RndGen.Next(randomLocationIdx + 1, randomLocationIdx + ScConstants.numPositions);

            nextRandomLocationIdx %= ScConstants.numPositions;

            if (RndGen.Next(ScConstants.numShapes + 1) > 0)
            {
                AddShape(nextRandomLocationIdx);
                Actions.Shapes[ShapeIndex] = true;
            }

            WriteActions();
        }
예제 #7
0
        protected override void CreateScene()
        {
            Actions = new AvatarsActions(false, true, false, false);

            if (RndGen.Next(ScConstants.numShapes + 1) > 0)
            {
                AddShape();
                Actions.Colors[ColorIndex] = true;
            }

            WriteActions();
        }
예제 #8
0
        protected virtual void CreateScene()
        {
            Actions = new AvatarsActions(true, false, false, false);

            if (RndGen.Next(ScConstants.numShapes + 1) > 0)
            {
                int randomLocationIdx = RndGen.Next(ScConstants.numPositions);
                AddShape(randomLocationIdx);

                Actions.Shapes[ShapeIndex] = true;
            }

            WriteActions();
        }
예제 #9
0
        protected override void CreateScene()
        {
            Actions = new AvatarsActions(true, false, false, false);

            if (RndGen.Next(ScConstants.numShapes + 1) > 0)
            {
                const int fixedLocationIndex = 4;
                AddShape(fixedLocationIndex);

                Actions.Shapes[ShapeIndex] = true;
            }

            WriteActions();
        }