コード例 #1
0
        // Command line argument: C:\Users\dilet\Desktop\TwitterDB
        static void Main(string[] args)
        {
            Console.WriteLine("Ego-Network Analysis Start (" + DateTime.Now.ToString() + ")\n");

            // Commandline Arguments
            string dirPath = args[0] + Path.DirectorySeparatorChar;

            // DB(.sqlite) List
            string[] dbCollection = Directory.GetFiles(dirPath, "*.sqlite");

            // Outfile Setting
            string outFilePath = args[0] + Path.DirectorySeparatorChar + "EgoNetwork_Analysis.txt";

            if (File.Exists(outFilePath))
            {
                File.Delete(outFilePath);
            }

            // <Ego, dbPath> Sorted by Ego ID(Ascending)
            SortedDictionary <long, string> egoList = new SortedDictionary <long, string>();

            foreach (string dbPath in dbCollection)
            {
                long egoID = long.Parse(Path.GetFileNameWithoutExtension(dbPath));
                egoList.Add(egoID, dbPath);
            }

            // Ego-Network Analysis
            foreach (KeyValuePair <long, string> kvp in egoList)
            {
                long          egoID     = kvp.Key;
                string        dbPath    = kvp.Value;
                SQLiteAdapter dbAdapter = new SQLiteAdapter(dbPath);
                Console.WriteLine(egoID + " Started");

                // Configure Ego-Network
                EgoNetwork egoNetwork = new EgoNetwork(egoID);
                // Construct Ego-Network Information
                egoNetwork.setNetworkInformation(dbAdapter);
                // Anaylize Ego-Network
                egoNetwork.startNetworkAnalysis(dbAdapter, outFilePath);

                dbAdapter.closeDB();
            }
        }
コード例 #2
0
        // Command line argument: C:\Users\dilet\Desktop\TwitterDB
        static void Main(string[] args)
        {
            Console.WriteLine("Ego-Network Analysis Start (" + DateTime.Now.ToString() + ")\n");

            // Commandline Arguments
            string dirPath = args[0] + Path.DirectorySeparatorChar;

            // DB(.sqlite) List
            string[] dbCollection = Directory.GetFiles(dirPath, "*.sqlite");

            // Outfile Setting
            string outFilePath = args[0] + Path.DirectorySeparatorChar + "EgoNetwork_Analysis.txt";
            if (File.Exists(outFilePath))
                File.Delete(outFilePath);

            // <Ego, dbPath> Sorted by Ego ID(Ascending)
            SortedDictionary<long, string> egoList = new SortedDictionary<long, string>();
            foreach(string dbPath in dbCollection)
            {
                long egoID = long.Parse(Path.GetFileNameWithoutExtension(dbPath));
                egoList.Add(egoID, dbPath);
            }

            // Ego-Network Analysis
            foreach(KeyValuePair<long, string> kvp in egoList)
            {               
                long egoID = kvp.Key;
                string dbPath = kvp.Value;
                SQLiteAdapter dbAdapter = new SQLiteAdapter(dbPath);
                Console.WriteLine(egoID + " Started");

                // Configure Ego-Network 
                EgoNetwork egoNetwork = new EgoNetwork(egoID);
                // Construct Ego-Network Information              
                egoNetwork.setNetworkInformation(dbAdapter);
                // Anaylize Ego-Network
                egoNetwork.startNetworkAnalysis(dbAdapter, outFilePath);

                dbAdapter.closeDB(); 
            }
        }