internal void AnalyzeQueries()
        {
            while (queries.Count > 0)
            {
                int rating;
                var query = queries.DeleteMin();

                if (stock2rating.ContainsKey(query.StockID))
                {
                    rating = stock2rating[query.StockID];
                }
                else
                {
                    rating = CalculateRating(query.StockID);
                    stock2rating.Add(query.StockID, rating);
                }
                if (rating > 80)
                {
                    stockTrader.EnqueueStockForTrading(query);
                }
            }
        }
        public void AnalyzeQueries()
        {
            while (queries.Count > 0)
            {
                int rating;
                var query = queries.DeleteMin(); // Get first-priority queries first

                //var cacheElement = stock2rating.Find(x => x.StockID == query.StockID);
                if (stock2rating.ContainsKey(query.StockID))
                {
                    rating = stock2rating[query.StockID];
                }
                else
                {
                    rating = CalculateRating(query.StockID);
                    stock2rating.Add(query.StockID, rating);
                }

                if (rating > 80) // Let's say that a rating of 80 triggers a stock trade
                {
                    stockTrader.EnqueueStockForTrading(query);
                }
            }
        }