public override void Compute()
        {
            string             TraceID = (string)Workspace.Load("TraceID");
            PDG                pdg     = (PDG)Workspace.Load("PDG");
            REngine            engine  = new REngine(_config.RScriptPath.Absolute);
            RScript            script  = new PageRankScript(TraceID, pdg, _config);
            TLSimilarityMatrix ranks   = (TLSimilarityMatrix)engine.Execute(script);

            Workspace.Store("Ranks", ranks);
        }
Exemple #2
0
        internal static PDG GeneratePDG(string traceFile, IEnumerable <string> rawMethods)
        {
            Console.WriteLine("Generating input PDG...");
            HashSet <string> prunedMethods = new HashSet <string>();

            foreach (string rawMethod in rawMethods)
            {
                prunedMethods.Add(rawMethod.Substring(0, rawMethod.IndexOf('(')));
            }
            return(PDG.Convert(JPDA.GenerateBiGrams(traceFile, prunedMethods)));
        }
Exemple #3
0
        public override void Compute()
        {
            string traceID = (string)Workspace.Load("TraceID");
            TLArtifactsCollection artifacts = (TLArtifactsCollection)Workspace.Load("Artifacts");
            BiGramCollection      bigrams   = JPDA.GenerateBiGrams(Path.Combine(_config.TraceDirectory, traceID), new HashSet <string>(artifacts.Keys));
            PDG           pdg    = PDG.Convert(bigrams);
            ISet <string> unique = JPDA.GenerateUniqueMethods(Path.Combine(_config.TraceDirectory, traceID));

            Workspace.Store("PDG", pdg);
            Workspace.Store("UniqueMethods", unique);
        }
Exemple #4
0
        public override void Compute()
        {
            string     TraceID = (string)Workspace.Load("TraceID");
            PDG        pdg     = (PDG)Workspace.Load("PDG");
            REngine    engine  = new REngine(_config.RScriptPath.Absolute);
            RScript    script  = new HITSScript(TraceID, pdg, _config);
            HITSResult results = (HITSResult)engine.Execute(script);

            Workspace.Store("Hubs", results.Hubs);
            Workspace.Store("Authorities", results.Authorities);
        }
Exemple #5
0
    void OnPostRender()
    {
        if (toggleDelaunay)
        {
            StartCoroutine(drawDelaunay());
        }

        if (toggleHallways)
        {
            StartCoroutine(PDG.drawHallways());
        }

        if (togglePrims)
        {
            StartCoroutine(PDG.drawPrim());
        }
    }
        public void BinaryTest()
        {
            string             rankFile = traceRoot + ".PageRank.binary.ranks.Beta85";
            TLSimilarityMatrix oracle   = WebMiningTestUtils.GenerateOracle(rankFile, mapFile);
            PDG pdg = WebMiningTestUtils.GeneratePDG(traceFile, rawMethods);

            Console.WriteLine("Executing script...");
            REngine engine = new REngine(Settings.Default.RScriptEXE);
            RScript script = new PageRankScript("trace", pdg,
                                                new PageRankConfig
            {
                Epsilon = epsilon,
                Beta    = beta,
                Weight  = WebMiningWeightEnum.Binary,
            }
                                                );
            TLSimilarityMatrix results = (TLSimilarityMatrix)engine.Execute(script);

            WebMiningTestUtils.CompareResults(oracle, results, rawMethods);
        }
Exemple #7
0
        public void BinaryTest()
        {
            string             authorityFile   = traceRoot + ".HITS.binary.ranks.authorities";
            string             hubFile         = traceRoot + ".HITS.binary.ranks.hubs";
            TLSimilarityMatrix oracleAuthority = WebMiningTestUtils.GenerateOracle(authorityFile, mapFile);
            TLSimilarityMatrix oracleHub       = WebMiningTestUtils.GenerateOracle(hubFile, mapFile);
            PDG pdg = WebMiningTestUtils.GeneratePDG(traceFile, rawMethods);

            Console.WriteLine("Executing script...");
            REngine engine = new REngine(Settings.Default.RScriptEXE);
            RScript script = new HITSScript("trace", pdg,
                                            new HITSConfig
            {
                Epsilon = epsilon,
                Weight  = WebMiningWeightEnum.Binary,
            }
                                            );
            HITSResult results = (HITSResult)engine.Execute(script);

            WebMiningTestUtils.CompareResults(oracleAuthority, results.Authorities, rawMethods);
            WebMiningTestUtils.CompareResults(oracleHub, results.Hubs, rawMethods);
        }
Exemple #8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="traceID">Trace id</param>
 /// <param name="pdg">Program dependency graph</param>
 /// <param name="config">Configuration object</param>
 public HITSScript(string traceID, PDG pdg, HITSConfig config) : base()
 {
     _pdg     = pdg;
     _config  = config;
     _traceID = traceID;
 }
Exemple #9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="traceID">Trace id</param>
 /// <param name="pdg">Program dependency graph</param>
 /// <param name="config">Configuration object</param>
 public PageRankScript(string traceID, PDG pdg, PageRankConfig config) : base()
 {
     _pdg     = pdg;
     _config  = config;
     _traceID = traceID;
 }