private List <SpaceTimePoint> ParseSpaceTime(string filePath) { List <SpaceTimePoint> points = new List <SpaceTimePoint>(); string line; StreamReader file = new StreamReader(filePath); // Iterate over each line in the input while ((line = file.ReadLine()) != null) { string[] split = line.Split(','); SpaceTimePoint point = new SpaceTimePoint(int.Parse(split[0]), int.Parse(split[1]), int.Parse(split[2]), int.Parse(split[3])); points.Add(point); } file.Close(); return(points); }
private int GetDistance(SpaceTimePoint pointOne, SpaceTimePoint pointTwo) { return(Math.Abs(pointOne.X - pointTwo.X) + Math.Abs(pointOne.Y - pointTwo.Y) + Math.Abs(pointOne.Z - pointTwo.Z) + Math.Abs(pointOne.T - pointTwo.T)); }