University Schedule Planning Project Using Genetic Algorithm (JAVA)


Personal information: Hi everyone, I am a computer science student; which is (unfortunately) supposed to work on this NP-complete problem for my Final Year project. I am not that proficient in programming other than my assignments and the things I learned at university. So I apologize for any uninformed questions I might ask.


University Schedule Planning Project Using Genetic Algorithm:

This is my theme for the final project of the university. I have already gathered the information I need and wrote my proposal and progress report, so I am fully aware of the fact that this topic is NP-Complete. However, the goal of my project is not to create a golden schedule that is completely optimal and hassle-free, but instead I just have to make sure it is acceptable and does not violate some of my rules.

As far as my methodology and how I want to create this application, I decided to use two main artificial intelligence techniques to solve the problem; Genetic Algorithm and Limiting Constraints. I came up with some rules and divided them into two main groups; soft limits and hard limits. So the algorithm should work like this:

, ( , , , ). . , (, , ). , . . . , ; , , , ( ) . , (, , , ..), GA GA.


This was all a good approach to solving the problem until I started programming. It's good that they looked good on paper, but my programming skills are holding me back from completing the project.

I have some questions regarding the coding part and I would appreciate if you guys can help me.

Questions: 1. Any good tutorial and guideline for genetic algorithms libraries in java? I decided to use Jgap, from people's suggestions on other topics, but I can't find a good tutorial on the internet about this, and unfortunately after looking at some of the examples provided in the Jgap library I still can't figure it out , what is happening there.


  1. For the constraint programming part that I want to apply, do I need to use any particular Java library, or can I do it using If / Else or switch commands? If so, please give me the name and details.

The most important question:  1. How to create a schedule? Ok, as I said, I'm not a very good programmer. So you can assume that I am stuck in the first phase of my project by creating a schedule. Should I treat it as an object? and what data structure do you usually use to create such as schedule? Array, linklist, queue?

Here's my attempt at creating a schedule:


                              **UPDATED**

      

After working sometimes on this project. I managed to create a schedule. Here is an update for the classes that I previously shared.

public class Subject {


public String name;
public int Students;
public String NameOfLecturer;
public ClassVenu addVenues;

public Subject(String argName, String argNameofLecturer, int  argStudents) 
{ name = argName; NameOfLecturer=argNameofLecturer; Students=argStudents;

}

public String toString() { return name;}}

      


public class ClassVenu {
  public String ClassName;
public int ClassCapacity;

public ClassVenu(int argClassCapacity, String argClassName)
{ ClassName = argClassName; ClassCapacity = argClassCapacity; }

    }

      


public class Days extends Hours{

public Days(Subject a, Subject b,Subject c, Subject d,Subject e, Subject  f,Subject g,Subject h, Subject j)
{int i=0;
   TimeSlot[i]=a;
    TimeSlot[i+1]=b;
     TimeSlot[i+2]=c;
      TimeSlot[i+3]=d;
       TimeSlot[i+4]=e;
        TimeSlot[i+5]=f;
         TimeSlot[i+6]=g;
          TimeSlot[i+7]=h;
           TimeSlot[i+8]=j;

   }

      


package fyp_small_timetable;
public class Hours {
public Subject [] TimeSlot = new Subject[9];

      

}


 package fyp_small_timetable;



public static void main(String[] args) {
    //creating Subjects
Subject A = new Subject("Human Computer Interaction", "Batman" , 49);
Subject B = new Subject("Artificial Intelligence", "Batman" , 95);
Subject C = new Subject("Human Computer Interaction", "Batman" ,180);
Subject D = new Subject("Human Computer Interaction", "Batman" , 20);
Subject E = new Subject("Empty", "No-One", 0);
    //Creating Class Venue
ClassVenu Class1 = new ClassVenu(100,"LecturerTheater1");
ClassVenu Class2 = new ClassVenu(50,"LecturerTheater2");
ClassVenu Class3 = new ClassVenu(200,"LecturerTheater3");

    //Creating Days
Days Day1 =new Days(A, A, E, B, B, E, E, A, A);
Days Day2 =new Days(C, C, E, D, D, E, E, A, A);
Days Day3 =new Days(E, E, E, B, B, E, E, A, A);
Days Day4 =new Days(C, C, E, C, C, E, E, A, A);
Days Day5 =new Days(A, A, E, B, B, E, E, A, A);


//creating Timetable
TimeTable T1 = new TimeTable(Day1, Day2, Day3, Day4, Day5);

List<Subject> answer = T1.ShowTimetable(T1);
System.out.println(answer);


}

}

      


Please keep in mind that the above code is just a prototype (my attempt at creating a schedule).

If anyone would like to help me, I can provide complete documentation of what I have done so far on this project.


Thanks to everyone who helps me and wishes this to help other people of Hirad

+3


source to share


1 answer


I used genetic algorithms to solve the scheduling problem in a production application.

Don't worry about the library to use many great Java libraries there.

What you should look out for is how you code your candidate schedules. Typically you should use a numeric representation, for example ['math', 'chemistry', physics] = [1, 4, 6] each number represents a unique class, while the index of that number represents the time at which the class will be offered. The fitness function will then take on a multidimensional array of values ​​representing the collection of candidate lists, then this population will be compared against the student list and constraints such as collision and eventual fitness calculations.



You might also consider normalizing health .

The most important thing is not to use objects to store your schedule information instead of using simple integer arrays, this will greatly increase the speed of your general algorithm.

0


source







All Articles