コード例 #1
0
 public override int TimeOnResignOffer(GameState gamestate, ResignResponseHint hint)
 {
     //  Parameter   Values
     //  Mean        3000 ms
     //  Minimum     1000 ms
     //  Maximum     8000 ms
     //  Deviation   2.0 (95.4% are within 2000 ms from mean)
     return((int)(coefficient * Gaussian.Next(3000, 1000, 8000, 2000, 2.0)));
 }
コード例 #2
0
        public NeuralThinker(IEnumerable <GameStateMoveAction> moves,
                             IEnumerable <GameStateDoubleAction> doubles,
                             IEnumerable <GameStateResignAction> resigns,
                             IEnumerable <GameStateTurnAction> turns)
        {
            GnuBgHintModule gnubg = new GnuBgHintModule(@"gnubg/ipoint.exe");

            gnubg.Initialize();

            foreach (GameStateMoveAction gsma in moves)
            {
                List <PlayHint> hints = gnubg.PlayHint(gsma.Original, 500);

                this.moves.Add(new KeyValuePair <GameStateAction, Vector>(gsma, ToMoveInput(gsma, hints)));
            }

            foreach (GameStateDoubleAction gsda in doubles)
            {
                DoubleResponseHint hint = gnubg.DoubleResponseHint(gsda.GameState);

                //Vector vector = new Vector(hint.TakeEq, hint.PassEq, System.Math.Abs(hint.PassEq - hint.TakeEq));
                this.doubles.Add(new KeyValuePair <GameStateAction, Vector>(gsda, ToDoubleInput(gsda.GameState, hint)));
            }

            foreach (GameStateResignAction gsra in resigns)
            {
                ResignResponseHint hint = gnubg.ResignResponseHint(gsra.GameState);

                Vector vector = new Vector();

                this.resigns.Add(new KeyValuePair <GameStateAction, Vector>(gsra, vector));
            }

            foreach (GameStateTurnAction gsta in turns)
            {
                DoubleHint hint = null;
                if (gsta.GameState.CanDouble())
                {
                    hint = gnubg.DoubleHint(gsta.GameState);
                }

                this.turns.Add(new KeyValuePair <GameStateAction, Vector>(gsta, ToTurnInput(gsta.GameState, hint)));
            }

            random.Next();
            random.Next();
        }
コード例 #3
0
        public override int TimeOnResignOffer(GameState gamestate, ResignResponseHint hint)
        {
            if (hint.Response == ResignResponse.Reject)
            {
                if (random.Next(5) == 0)
                {
                    return(random.Next(2000, 4000));
                }

                return(random.Next(1000, 3000));
            }

            if (random.Next(5) == 0)
            {
                return(random.Next(2000, 4000));
            }

            return(random.Next(1000, 2500));
        }
コード例 #4
0
 public override int TimeOnResignOffer(GameState gamestate, ResignResponseHint hint)
 {
     return(random.Next(1000, 3000));
 }
コード例 #5
0
 public abstract int TimeOnResignOffer(GameState gamestate, ResignResponseHint hint);
コード例 #6
0
 public override int TimeOnResignOffer(GameState gamestate, ResignResponseHint hint)
 {
     return(0);
 }