コード例 #1
0
        public static CustomGraph createGraph(String path)
        {
            if (getLessons().Count == 0)
                InitializeLessons();
            CustomGraph graph = new CustomGraph(path, "SIMPLE");

            //CustomGraph graph = new CustomGraph(@"..\..\Resources\assests\Matrices.txt", "SIMPLE");

            //CustomGraph graph = new CustomGraph(@"Resources\assests\Matrices.txt", "SIMPLE");
            return graph;
        }
コード例 #2
0
        public static CustomGraph createGraph(String path)
        {
            if (getLessons().Count == 0)
            {
                InitializeLessons();
            }
            CustomGraph graph = new CustomGraph(path, "SIMPLE");

            //CustomGraph graph = new CustomGraph(@"..\..\Resources\assests\Matrices.txt", "SIMPLE");

            //CustomGraph graph = new CustomGraph(@"Resources\assests\Matrices.txt", "SIMPLE");
            return(graph);
        }
コード例 #3
0
        public static List <int> getPreReqsForLesson(int lesson_id)
        {
            List <int>  adj_ids = new List <int>();
            CustomGraph g       = new CustomGraph(@"..\..\Resources\assests\Matrices.txt", "SIMPLE");

            // CustomGraph g = Controller.GetLessonGraphs().ElementAt(0);
            // Console.WriteLine("tOTAL gRAPHS :"+Controller.GetLessonGraphs().Count);

            for (int i = 0; i < g.NumberNodes; i++)
            {
                if (g.AreAdjacent(lesson_id, i))
                {
                    adj_ids.Add(i);
                    LessonPreReq pre = getPreReq(i);
                    if (pre != null)
                    {
                        getLesson(lesson_id).PreReqs.Add((pre));
                    }
                    //Console.WriteLine("Oh Yes ADDED");
                }
            }
            //MessageBox.Show(adj_ids.Count + "");
            return(adj_ids);
        }
コード例 #4
0
        public static List<int> getPreReqsForLesson(int lesson_id)
        {
            List<int> adj_ids = new List<int>();
            CustomGraph g = new CustomGraph(@"..\..\Resources\assests\Matrices.txt", "SIMPLE");
            // CustomGraph g = Controller.GetLessonGraphs().ElementAt(0);
            // Console.WriteLine("tOTAL gRAPHS :"+Controller.GetLessonGraphs().Count);

            for (int i = 0; i < g.NumberNodes; i++)
            {
                if (g.AreAdjacent(lesson_id, i))
                {
                    adj_ids.Add(i);
                    LessonPreReq pre = getPreReq(i);
                    if (pre != null)
                        getLesson(lesson_id).PreReqs.Add((pre));
                    //Console.WriteLine("Oh Yes ADDED");
                }

            }
            //MessageBox.Show(adj_ids.Count + "");
            return adj_ids;
        }