コード例 #1
0
ファイル: Program.cs プロジェクト: dileepa123/CS5232Games
        private static void setglobalAction(int i0, int a_i, GlobalAction a_z, GlobalAction a_al)
        {
            int        bizcount = 0;
            int        alcount  = 0;
            List <int> byz      = a_z.getLocalActions();  //as a list of local actions
            List <int> al       = a_al.getLocalActions(); //as a list of local actions

            //only the size matters
            for (int i = 0; i < n; i++)
            {
                if (i == i0)
                {
                    Actions[i] = a_i;//not taken from any list
                }
                else if (bybool[i])
                {
                    Actions[i] = byz[bizcount];
                    bizcount++;
                }
                else
                {
                    Actions[i] = al[alcount];
                    alcount++;
                }
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: dileepa123/CS5232Games
        private static void setglobalAction(int i0, int j0, GlobalAction a_ij, GlobalAction a_z, GlobalAction a_al)
        {
            int        bizcount = 0;
            int        alcount  = 0;
            List <int> byz      = new List <int>();

            if (a_z != null)
            {
                byz = a_z.getLocalActions();//as a list of local actions Z
            }
            List <int> al;

            if (a_al != null)
            {
                al = a_al.getLocalActions();//as a list of local actions Al-ij
            }
            else
            {
                al = new List <int>();
            }
            for (int i = 0; i < n; i++)
            {
                if (i == i0)
                {
                    Actions[i] = a_ij.getLocalActions()[0];//not taken from any list
                }
                else if (i == j0)
                {
                    Actions[i] = a_ij.getLocalActions()[1];//not taken from any list
                }
                else if (bybool[i])
                {
                    Actions[i] = byz[bizcount];//actions from Z
                    bizcount++;
                }
                else
                {
                    Actions[i] = al[alcount];//actions from Al-ij
                    alcount++;
                }
            }
        }