Plug-In Algorithm framework for Lekin
Exercise for weeks 3-5 of Scheduling course

The purpose of this exercise is to set up a framework for creating plug-in algorithms that can be easily reused for any algorithm. You will test the framework with a simple algorithm: Random order for single machine. When the exercise is complete, you will be able to reuse the framework again and again for implementations of more complicated algorithms, not having to worry about stuff such as reading and writing from files anymore.

This is a three week exercise composed of intermediate due-dates. At each such due-date, your group will receive a grade for the progress achieved so far.
Below are the intermediary goals and their respective dates:

An estimate of the size of this project is 20 programmer hours. Divide this up by 3 programmers and 3 weeks and you should be ok. It is recommended that you assign a "group leader/coordinator" for each group. This should be the person with the most OO experience/understanding. Having such a designated leader in the group will make your joint work more efficient.

What is expected of the framework

The plug-in framework will be a stand alone executable program. It will be composed of classes such as class Machines, class Jobs and class Schedule. These classes should have constructors that get file names as parameters. They should have methods for inquiring/setting the structure of the jobs/machines/schedule. (It is your job for the first week to think of what these methods should be, based on what you think an algorithm might need to know about the jobs, machines or the schedule that it is creating. The jobs and machines classes should obviously have a method for reading from file. And the Schedule class should have a method for writing to the file. You may also need to create other classes that are used by these classes (for example, a class for an individual job or machine). When implementing these classes (during the second week), you shouldn't bother too much with the efficiency of the data structures. Also, you may want to use the Standard Template Library (STL).

The framework should contain some abstract class such as class Algorithm. Specific algorithms will be inherited from this class. The framework shouldn't care which algorithm it is working with, it should know to call some method of the algorithm such as schedule(). This method should be a pure virtual method in class Algorithm and should be implemented differently for each algorithm class that we will implement during the continuation of the course (starting with random). It seems pretty reasonable that the constructor for the algorithm class will receive pointers to the machines, jobs and schedule classes.

Note1: You should re-read the help from lekin about implementing algorithms and pay close attention to what it says about objective functions. Your algorithm class should have some sort of static method such as whichObjectives() which returns the objective functions which are suppurated.

Note2: You should also pay attention to the differences between single machines, job shops and flow shops and incorporate these in your classes.

Below is a skeleton of what the framework may look like (just a non-formal suggestion):

int main(int argc, char ** argv)
{
	//parse argv here
	int objective=;//value of objective parsed from argv

	try{
			Schedule schedule("filename");
			Jobs jobs("filename");
			Machines machines("filename");
	}catch(/*catch file input exceptions here and exit(1)*/){}

	Algorithm * palgorithm =
		new randomAlgorithm(cout,&schedule, &jobs,&machines,objective);

	//NOTE: the above literal, randomAlgorithm, is the only thing that should change
	when you continue the course and implement a different algorithm. (This is what
	creating a framework and using polymorphism is all about.)

	//NOTE2: I thought it is nice to have the algorithm get a refernce to an ostream
	//so that it doesn't necssarily need to write comments to cout (stdout).
	//But can actually write to a diffrent output stream such as a file output stream.

	if(*palgorithm does not suppurts objective)
		exit(1);

	try{
		palgorithm->(&schedule,&jobs,&machines,objective);
	}catch//catch scheduling errors

	schedule.writeToFile();

	return 0;
}

Good Luck