Beispiel #1
0
        /// <summary>
        /// @see Search.SearchManager#allocate()
        /// </summary>
        public override void Allocate()
        {
            _totalTokensScored = StatisticsVariable.GetStatisticsVariable("totalTokensScored");
            _tokensPerSecond   = StatisticsVariable.GetStatisticsVariable("tokensScoredPerSecond");
            _curTokensScored   = StatisticsVariable.GetStatisticsVariable("curTokensScored");
            TokensCreated      = StatisticsVariable.GetStatisticsVariable("tokensCreated");
            _viterbiPruned     = StatisticsVariable.GetStatisticsVariable("viterbiPruned");
            _beamPruned        = StatisticsVariable.GetStatisticsVariable("beamPruned");

            try
            {
                Linguist.Allocate();
                _pruner.Allocate();
                _scorer.Allocate();
            }
            catch (IOException e)
            {
                throw new SystemException("Allocation of search manager resources failed", e);
            }

            _scoreTimer = TimerPool.GetTimer(this, "Score");
            _pruneTimer = TimerPool.GetTimer(this, "Prune");
            GrowTimer   = TimerPool.GetTimer(this, "Grow");
        }
        public override void Allocate()
        {
            // tokenTracker = new TokenTracker();
            // tokenTypeTracker = new TokenTypeTracker();

            ScoreTimer = TimerPool.GetTimer(this, "Score");
            PruneTimer = TimerPool.GetTimer(this, "Prune");
            GrowTimer  = TimerPool.GetTimer(this, "Grow");

            TotalTokensScored = StatisticsVariable.GetStatisticsVariable("totalTokensScored");
            CurTokensScored   = StatisticsVariable.GetStatisticsVariable("curTokensScored");
            TokensCreated     = StatisticsVariable.GetStatisticsVariable("tokensCreated");

            try
            {
                Linguist.Allocate();
                Pruner.Allocate();
                Scorer.Allocate();
            }
            catch (IOException e)
            {
                throw new SystemException("Allocation of search manager resources failed", e);
            }
        }