private void ProcessAuthor(Scientist scientist, int i) { String coName = ""; int maxDistance = 2; for (int k=0; k < scientist.CoAuthors.Count; k++) { if (scientist.CoAuthors[k].Name.Equals(_masterAuthor)) { _LAuthors[i].Distance = 1; return; } int coDist = scientist.CoAuthors[k].Distance; if (coDist < maxDistance && coDist >= 1) { maxDistance += 1; coName = scientist.CoAuthors[k].Name; } } _LAuthors[i].Distance = maxDistance; }
public void AddCoAuthor(Scientist scientist) { _CoAuthors.Add(scientist); }
static void Main(string[] args) { List<Paper> _LPaper = new List<Paper>(); Paper p1 = new Paper("P1"); Scientist s1p1 = new Scientist(); s1p1.Name = "Andreas"; Scientist s2p1 = new Scientist(); s2p1.Name = "Berta"; Scientist s3p1 = new Scientist(); s3p1.Name = "Charlie"; Scientist s4p1 = new Scientist(); s4p1.Name = "Erdoes"; p1.AddAuthor(s1p1); p1.AddAuthor(s2p1); p1.AddAuthor(s3p1); p1.AddAuthor(s4p1); Paper p2 = new Paper("P2"); Scientist s1p2 = new Scientist(); s1p2.Name = "Franz"; Scientist s2p2 = new Scientist(); s2p2.Name = "Georg"; Scientist s3p2 = new Scientist(); s3p2.Name = "Erdoes"; p2.AddAuthor(s1p2); p2.AddAuthor(s2p2); p2.AddAuthor(s3p2); Paper p3 = new Paper("P3"); Scientist s1p3 = new Scientist(); s1p3.Name = "Hans"; Scientist s2p3 = new Scientist(); s2p3.Name = "Charlie"; Scientist s3p3 = new Scientist(); s3p3.Name = "Jens"; p3.AddAuthor(s1p3); p3.AddAuthor(s2p3); p3.AddAuthor(s3p3); _LPaper.Add(p1); _LPaper.Add(p2); _LPaper.Add(p3); _programInstance = new ErdoesSolver(_LPaper); Console.WriteLine("Done."); Console.WriteLine("Press enter to close."); Console.ReadLine(); }
public void AddAuthor(Scientist scientist) { _authorList.Add(scientist); }