コード例 #1
0
ファイル: WolfAgent.cs プロジェクト: DanTulovsky/Sheep-Wolf
    // mask some moves as not possible
    public override void CollectDiscreteActionMasks(DiscreteActionMasker actionMasker)
    {
        List <bool> possibleMoves = wolfSquareController.PossibleWolfMovesDir();

        List <int> notAllowed = new List <int>()
        {
        };

        for (int i = 0; i < possibleMoves.Count; i++)
        {
            if (!possibleMoves[i])
            {
                notAllowed.Add(i); // add the movement number that is not allowed
            }
        }

        actionMasker.SetMask(0, notAllowed);
    }