public override void main() { ((IStringInstance)Input_data.Instance).Value = readInput(); IIteratorInstance <IKVPair <IString, IDouble> > output_data_instance = (IIteratorInstance <IKVPair <IString, IDouble> >)Output_data.Instance; long t0 = (long)(DateTime.UtcNow - (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc))).TotalMilliseconds; Page_rank.go(); long t1 = (long)(DateTime.UtcNow - (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc))).TotalMilliseconds; string saida = ((IStringInstance)Input_data.Instance).Value; int count = 0; double X = 0.0; string[] lines = saida.Split(new char[] { System.Environment.NewLine[0] }); foreach (string line in lines) { if (!line.Trim().Equals("")) { string[] prank = line.Split(' '); if (prank [0].Equals("X")) { X = double.Parse(prank [1]); } else { count++; } } } saida = ""; double slice = X / count; foreach (string line in lines) { if (!line.Trim().Equals("")) { string[] prank = line.Split(' '); if (!prank [0].Equals("X")) { saida = saida + prank [0] + " " + (double.Parse(prank [1]) + slice) + System.Environment.NewLine; } } } //saida = saida + System.Environment.NewLine + "Time=" + (t1 - t0)+"PG"; saida = "Time=" + (t1 - t0) + "PG"; writeFile("./outPageRankApp", saida); }
public override void main() { Page_rank.go(); }