public static ProblemVacuum Import(string filePath) { StreamReader reader = new StreamReader(filePath); string json = reader.ReadToEnd(); reader.Close(); ProblemVacuum map = JsonUtility.FromJson <ProblemVacuum>(json); map.read_polygons(json); return(map); }
// Use this for initialization void Start() { problem = ProblemVacuum.Import(problemPath); bois = new List <MotionModelVacuum>(); points = new List <GameObject>(); spawnObjects(); prim = new Prims(problem.obstacles, problem.pointsOfInterest, scanningRadius); List <float[]> goodpoints = prim.getNewPointsOfInterest(); som = new SOMVacuum(goodpoints, problem.startPositions, problem.goalPositions); List <float[]> interestings = new List <float[]>(); interestings.AddRange(goodpoints); interestings.AddRange(problem.goalPositions); interestings.AddRange(problem.startPositions); cooldown = waitTime; vGraph = new VisibilityGraphVacuum(problem.obstacles, interestings); drawRadius(cooldown, goodpoints); Debug.Break(); }