Esempio n. 1
0
        protected float Playout(WorldModelDST initialPlayoutState)
        {
            List <ActionDST> actions;

            WorldModelDST clone = initialPlayoutState.GenerateChildWorldModel();

            CurrentDepth = 0;
            //int parentID = 0; // ?
            int size = 0, random = 0;

            while (CurrentDepth < MaxPlayoutDepthReached)
            {
                actions = clone.GetExecutableActions();
                foreach (var a in actions)
                {
                    //Console.WriteLine(a);
                }

                size = actions.Count;
                //Console.WriteLine("size:" + size);

                random = this.RandomGenerator.Next(0, size - 1);
                actions[random].ApplyActionEffects(clone);

                //Had clone.getNextPlayer here in proj algorithm
                CurrentDepth++;
            }
            //return score
            return(initialPlayoutState.Score());
        }