Пример #1
0
        public void Update(GuessStrategyArgs args)
        {
            // 実行結果のクリア
            guessList.Clear();

            foreach (DayInfo dayInfo in args.Agi.DayInfo.Values)
            {
                // その日の投票の取得
                VoteAnalyzer voteAnalyzer = null;
                if (dayInfo.VoteList.Count > 0)
                {
                    // 実際の投票(1回目の投票のみ)
                    voteAnalyzer = new VoteAnalyzer(dayInfo.VoteList[0]);
                }
                else if (dayInfo.Equals(args.Agi.TodayInfo))
                {
                    // 投票宣言
                    voteAnalyzer = new VoteAnalyzer(dayInfo.LatestAliveAgentList, dayInfo.TalkList, Topic.VOTE);
                }

                if (voteAnalyzer != null)
                {
                    foreach (KeyValuePair <Agent, Agent> vote in voteAnalyzer.VoteMap)
                    {
                        if (vote.Value != null)
                        {
                            BitCondition con = new BitCondition();
                            con.AddWerewolf(vote.Key);
                            con.AddWerewolf(vote.Value);
                            guessList.Add(new PartGuess()
                            {
                                Condition   = con,
                                Correlation = 0.7,
                            });

                            con = new BitCondition();
                            con.AddNotWerewolf(vote.Key);
                            con.AddNotWerewolf(vote.Value);
                            guessList.Add(new PartGuess()
                            {
                                Condition   = con,
                                Correlation = 0.95,
                            });
                        }
                    }
                }
            }

            // 実行成功にする
            isSuccess = true;
        }
Пример #2
0
        public void IsNotWolf_False()
        {
            BitCondition con = new BitCondition();

            con.AddNotWerewolf(Agent.GetAgent(8));

            Assert.AreEqual(con.IsMatch(pattern), false);
        }
Пример #3
0
        /// <summary>
        /// 判定から村騙りが無い場合の内訳を絞り込む
        /// </summary>
        /// <param name="judge"></param>
        private void RemovePatternFromJudge(Judge judge)
        {
            BitCondition con = new BitCondition();

            con.AddNotWerewolfTeam(judge.Agent);
            if (judge.Result == Species.HUMAN)
            {
                con.AddWerewolf(judge.Target);
            }
            else
            {
                con.AddNotWerewolf(judge.Target);
            }

            AllViewTrustInfo.RemoveMatchPattern(con);
        }
Пример #4
0
        public void Update(GuessStrategyArgs args)
        {
            // 実行結果のクリア
            guessList.Clear();

            // 自分の判定は100%信じる
            foreach (AIWolf.Lib.Judge judge in args.Agi.MySeerJudge)
            {
                guessList.Add(new PartGuess()
                {
                    Condition   = RoleCondition.GetCondition(judge.Target, Role.WEREWOLF),
                    Correlation = (judge.Result == Species.WEREWOLF) ? 10.0 : 0.0,
                });
            }

            // 役職CO者を取得
            List <Agent> seerList = args.Agi.GetComingOutAgent(Role.SEER);

            // 判定騙りをするエージェントを取得(推測)
            AgentStatistics statistics   = (AgentStatistics)args.Items["AgentStatistics"];
            List <Agent>    liarSeerList = new List <Agent>();

            foreach (Agent agent in seerList)
            {
                int roleEveCnt  = statistics.statistics[agent].eventCount[Role.SEER].GetOrDefault("1d_DevineWhite", 0);
                int roleEveCnt2 = statistics.statistics[agent].eventCount[Role.SEER].GetOrDefault("1d_DevineBlack", 0);

                if (roleEveCnt + roleEveCnt2 >= 5 && roleEveCnt2 > roleEveCnt)
                {
                    liarSeerList.Add(agent);
                }
            }

            foreach (Wepwawet.Lib.Judge judge in args.Agi.SeerJudge)
            {
                double fakeBlaskJudgeRate = 0.1;
                if (liarSeerList.Contains(judge.Agent))
                {
                    fakeBlaskJudgeRate = 3.0 / 4.0 * 2.0 / 3.0;
                }

                // 村陣営が人間に人狼判定
                if (judge.Result == Species.WEREWOLF)
                {
                    BitCondition con = new BitCondition();
                    con.AddNotWerewolfTeam(judge.Agent);
                    con.AddNotWerewolf(judge.Target);
                    guessList.Add(new PartGuess()
                    {
                        Condition   = con,
                        Correlation = fakeBlaskJudgeRate,
                    });
                }

                // 村陣営が人狼に人間判定
                if (judge.Result == Species.HUMAN)
                {
                    BitCondition con = new BitCondition();
                    con.AddNotWerewolfTeam(judge.Agent);
                    con.AddWerewolf(judge.Target);
                    guessList.Add(new PartGuess()
                    {
                        Condition   = con,
                        Correlation = 0.1,
                    });
                }
            }

            // COから村騙りが無い場合の内訳を絞り込む
            List <Agent> coAgent = args.Agi.GetComingOutAgent(Role.SEER);

            if (coAgent.Count >= 2)
            {
                BitMatchNumCondition con = new BitMatchNumCondition()
                {
                    MinNum = 0,
                    MaxNum = coAgent.Count - 2
                };
                foreach (Agent agent in coAgent)
                {
                    con.AddWerewolfTeam(agent);
                }
                guessList.Add(new PartGuess()
                {
                    Condition   = con,
                    Correlation = 0.1,
                });
            }

            // 実行成功にする
            isSuccess = true;
        }