示例#1
0
 public RlEpisod(RlSearch <StateId_t, Action_t> search, RlModel <StateId_t, Action_t> model, RlTree <StateId_t, Action_t>[] searchTrees, RlSearchParams searchParams)
 {
     m_search       = search;
     m_model        = model;
     m_searchModel  = m_model.rlModelClone();
     m_searchTrees  = searchTrees;
     m_records      = new RlRecord[m_model.rlModelGetActorsCount(), searchParams.maxGameLength + 10];
     m_recordsCount = new int[m_model.rlModelGetActorsCount()];
     m_searchParams = searchParams;
     //m_searchParams.biasTermConstant = Math.Sqrt(Math.Log(maxGames));
 }
示例#2
0
        // Coroutine based search
        public void Search(RlSearchParams searchParams, MonoBehaviour context)
        {
            m_searchParams = searchParams;
            m_searchThread = null;

            int actorsCount = m_model.rlModelGetActorsCount();

            m_searchTrees = new RlTree <StateId_t, Action_t> [actorsCount];
            for (int index = 0; index < m_searchTrees.Length; ++index)
            {
                m_searchTrees[index] = new RlTree <StateId_t, Action_t>();
            }

            // Start the search thread
            m_running = true;
            context.StartCoroutine(StartCo());
        }
示例#3
0
        // Thread based search
        public void Search(RlSearchParams searchParams)
        {
            m_searchParams = searchParams;
            m_searchThread = new Thread(Start);

            int actorsCount = m_model.rlModelGetActorsCount();

            m_searchTrees = new RlTree <StateId_t, Action_t> [actorsCount];
            for (int index = 0; index < m_searchTrees.Length; ++index)
            {
                m_searchTrees[index] = new RlTree <StateId_t, Action_t>();
            }

            // Start the search thread
            m_running = true;
            m_searchThread.Start();
        }