Ejemplo n.º 1
0
        //algorithm 0
        //for new algorthm need mimic bellow and replace GoogleMapHelper() to ur new function
        public void GoogleMap(int AlgorithmId)
        {
            while (true)
            {
                bool continue1 = startCheck();
                while (continue1)
                {
                    TwittersI ts = new Twitters();
                    ts.allTweets = database.loadBasicTweets(algorithmInfomations[AlgorithmId].lastMaxId + 1, this.TweetbnumberEachCycle);
                    if (ts.allTweets.Count != 0)//if nothing is loaded not run
                    {
                        //for new algorthm need to replace GoogleMapHelper() to ur new function
                        LocationHelper ghp = new GoogleMapHelper();


                        TwitterModel id = ghp.run(ts, AlgorithmId);
                        algorithmInfomations[AlgorithmId].lastMaxId = id.realTwitterId;
                        algorithmInfomations[AlgorithmId].lastDate  = id.createAt;
                        ts.saveLocationInTweets(AlgorithmId);
                        database.updateAlgorithmInfo(algorithmInfomations[AlgorithmId]);
                    }
                    else
                    {
                        continue1 = false;
                    }
                }
                Thread.Sleep(sleepInterval); // wait for sleepInterval, then continue
            }
        }