Link to home
Start Free TrialLog in
Avatar of jonasmit
jonasmit

asked on

Modeling a Scheduling System - Help with a good Design

I am attempting to model a system that acts like a course scheduler for a university.
I don't need to worry about particular days (so Date and Calendar don't seem useful).
I need to keep track of what days a course is offered and what time.  The course will
always meet the same times and days of week.  of course I need to keep track of this
and compare so 2 courses aren't meeting the same day and time in the same room.
A few design suggestions would be great I am not looking for code.
Avatar of bkrahmer
bkrahmer

This sounds like a homework problem.  If you want help, you're going to need to put a lot more effort into it.  You should be able to at least draft a couple ideas before asking for help.

brian
Avatar of jonasmit

ASKER

Weird...it is not homework I am simply trying to learn.  I am just trying to get good ideas on how to model this.  
A starting point if you will.

I could do:
Class Day - that specifies 24hrs in a day where each can be set to occupied (true or false) and then use this in a Class Course.  But this seems inefficient.
And besides not all classes would be 1hr.  And also I want to keep track of it from the standpoint of the Class room also (So to keep it consistent between objects could be a problem).

Any ideas?
There are quite a few details one would have to know in order to model the system.  What resource(s) do you want to maximize, minimize?  I could see many prioritized features of the program.  The most important thing you can do upfront is find out the requirements for the system.  Once you have all the requirements, you understand what the system is supposed to do, and you've gone through all of the use-cases with the customer, you can design a simple, robust system to accomplish their needs.  

How my system would work would depend on many answers to questions.  Are the rooms a tight resource that has to be efficient?  Do the number of professors need to be taken in mind to teach the classes?  Are there limits to class size?  Etc...

brian
of course you are right.  I am asking about the scheduling part only.  I want to know a good way to keep track of a period of time and whether it is occupied or not.  So, should I say from 8am to 5pm there are 9hours (0 to 8) and that adds up to 540 minutes (60 x 9) and assuming a granularity of 10 minutes. that would be 54 intervals in a data structure (array i guess).  and just accept a startTime and stopTime calculate the number of intervals necessary and set the data strucuture to indicate that interval is occupied.  I just think somebody has done this before and my thoughts aren't clear on a good way to solve this.  does this help explain what i am asking?
I ask of you a question: Why would one model time?  Time, by Einstein's theory, is relative.  Let your class object mention it's start and stop time.  I could see, perhaps, having a time or timespan object to represent a time.  However, an array still doesn't seem to fit.  Your last post is still incredibly nebulous.  What are you trying to solve, and what are all if it's attributes?

brian
say I have:

public class Course
{
String courseName;
String courseNumber;
int creditHours;
MeetingTimes meetingTimes;

}

public class MeetingTimes
{
int startTime;
int stopTime;
//Days of week?
}

What I am trying to figure out is how to specify the meeting Times in a nice way so I can put it in a database.
if I do this I could only check and see if the database had a course with a certain startTime, stopTime and the other aspects of course.  but I want to compare the timeSpan i guess.  Overlap not exact start and stop times.
ASKER CERTIFIED SOLUTION
Avatar of bkrahmer
bkrahmer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial