问题
I'm making a high school timetable genetic algorithm in java as a project, but I have couple questions in what direction I can approach this in.
What should be my chromosome encoding? An ArrayList that holds each value or perhaps a string?
How should I input and output the data? Should I hold the data in a excel and output the timetable as a GUI?
- Is there any essential knowledge a novice programmer should keep in mind when implementing the algorithm? So far the experience I've had with GA's is creating one which solves the Traveling Sales Man problem and evolving a population of random strings into "Hello World", but I'm afraid my lack of knowledge on databases and advanced concepts will bottleneck me from completing this project.
回答1:
- ArrayList because it is better for holding more data than a variable is. ArrayList is modifiable however, so make sure you really need it to be modifiable because it takes more performance than just an Array.
- Java can read and write to files. I wouldn't keep it in Excel format however, because I think it would be harder to read from. I would say keep it in a rawer format, maybe CSV.
- No project is too difficult to finish. As long as you have the time, the patience, and the willingness to learn, you will finish the project. A couple thoughts: I would look into JOptionPane or maybe even the console to present the final result. Also, look into FileWriter.
回答2:
To answer question 2 about input/output data and visualization:
Input/output data: I used the format of the ITC2007 compo. See my docs about the Curriculum Course example (which is high school timetabling).
Visualization: I used 3 tables (room, teacher and student group) as shown in this video.
But I didn't use GA's (because compo's like ITC2007 prove that they are inferior).
来源:https://stackoverflow.com/questions/27734684/high-school-timetable-using-a-genetic-algorithm