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); }
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))); }
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); }
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); }
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); }
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); }
/// <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; }
/// <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; }