wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes new Project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "new Project "automatic employee scheduling software", need some advice" Watch "new Project "automatic employee scheduling software", need some advice" New topic
Author

new Project "automatic employee scheduling software", need some advice

mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi,

I am thinking about starting a project and would like to ask first if it is possible to do in java, and if so how should i go about starting it?

I want to create a employee automatic work scheduler. That means that i would like to have a scheduler that creates automatically a work schedule for one month based on different variables for each employee.

(Some of the variables i can think of at the moment):

1. different employees have different amounts of hours that can be worked in one month.

2. certain employees are allowed to open and close(they can have a key). They would need to switch between the early shift to open and the late to close(one has late the other then has to have early).

3. can't be scheduled if they have vacation or a day off.

4. must have at least 1 work day off in a 6 day work period.

5. would need to have the employee switch from one day early to the next late unless specified they have a fixed shift daily.


I am sure i will think of more variables as i start this if it is even at all possible to do. This schedule must then be printable to possibly an open office document or PDF or something similar.

I am still pretty much a beginner although i have allot of the core java learned at this point (the rest i will have to figure out in time). This would actually be something i can use in real life , not just an idea out of the blue.I also
realise this will be a major project (at least for me lol)!!

any thoughts or ideas on beginning this would be much appreciated!!

PS: I don't want anyone to show me code for this, i just never really planned a larger project and would like some ideas on how i should start doing that, plus just want to know if something like this is even possible before i start and can never finish;)


Thanks Mike
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 561
A GUI program? I'll assume so.

I am sure i will think of more variables as i start this if it is even at all possible to do. This schedule must then be printable to possibly an open office document or PDF or something similar.


My recommendation is that you think about it a lot more. Write your thoughts down. Divide what you write down into program requirements, data requirements, and implementation specifics. When you start writing down your implementation specifics, draw sketches of what the GUI interfaces will look like. As you sketch, answer questions like, "What what will the interfaces do?" What components are required to accomplish that?" "How will the user know what to do?" "What data is required?"

As you go through that process from start to finish for each of the program's functions you'll come up with new requirements, implementation details you hadn't thought of, data requirements that aren't obvious.

Think it through until you think you've absolutely thought of everything and written down your thoughts, solutions, GUI sketches, implementation details, etc. THEN start programming. You'll find that roughly an equal number of new thoughts, requirements, questions, etc. will occur to you while you're writing the code, but that's okay. It's better to have even a 50% plan before writing a single line of code than to have no plan at all.


Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
Randall Fairman
Greenhorn

Joined: Apr 18, 2011
Posts: 29

Speaking more as a mathematician than as a Java coder, this could be quite a difficult problem. Coding the front end to the algorithm that decides on the schedule will be non-trivial, but it's certainly doable, and it sounds like a good exercise with plenty of opportunities to learn new things. You can make it as simple or as complex as you like. But before beginning the coding process, make sure that you understand how the schedule will be determined -- how the algorithm works. Depending on the number of employees, you may find that the problem is harder than you expect.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
Have you come across constraint programming? That is a branch of logic programming, supported by languages such as Prolog and Oz. In constraint programming, you can attach constraints (rules) to employee objects and the program can calculate a schedule very rapidly. One of our undergraduates did something similar for room availability about two years ago here. But that was in Oz. I don't think Java™ supports constraint programming, however.
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi,

Thanks to all of you for the feedback,I realised myself after thinking about how this program could work, that it will be very difficult to do.That is why i asked the experts here if it would even be possible,now the question is "will it be possible for me!!". I think this will be a chance to learn allot about the language and specially about algorithms.I just recently bought a book about algorithms, i forget the name at the moment,it is i think a little bit over my head mathmatically.I hope i can get some insight about how to do algorithms though from it.

I will do as Greg wrote and start with a pencil and paper, and see if i can work out a model, i also don't have much experience with interfaces and static methods, so i will probably make some poor choices to begin with i imagine, but will learn from the mistakes!!
I will keep you all posted on my progress, i also have to finish my Correspondence course in the next few months as well;)greg is correct this will be a GUI.

PS:

Thanks to all(and keep the tips comming;))

Mike
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
Get the logic behind it to work, and you can work out static methods later.
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi Campbell,

Thanks again for the advice, i did some searching about Constraint programming and came across this software called "Drools Planner" , that is open source as well.
Sounds like it can do pretty much what i wanted to do. here is a link to the website --> click me!
I think i will first attempt this on my own for learning purposes although i have a feeling it will be a bit difficult for me at this time but that won't stop me from trying anyway;) but when a Mathmetician says it will be hard then i get nervous lol.

Mike
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18651
    
    8

mike ryan wrote:but when a Mathmetician says it will be hard then i get nervous lol.


When we mathematicians say something is "hard", we're talking about the perfect solution. However in real life it's quite often sufficient to produce a "good enough" solution. Your employee-scheduling software may not scale up to be useful to, say, the State of California, but don't let that stop you from producing something that could be useful for a 10-person office.
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Thanks Paul, I will give it a try for sure. It is for a store with about 7 to 10 employees. I was just looking at the users manual for the Drools Planner and it showed some of the methods used in it.Is pretty complex so i stopped looking at it to see if i can find my own possibly simpler way to do it as i think ,as you said mine will not need to be at first so complicated.

Also just a note because i mentioned earlier that i bought a book about algorithms in java,the name is "A Concise and Practical introduction to Programming Algorithms in Java " written by Frank Nielson. Just in case that may intrest someone. I haven't read much yet as i haven't had time.Maybe if someone has read it they can let me know if it is a good book on algorithms.


Thanks again
Mike
Geoffrey De Smet
Greenhorn

Joined: Sep 14, 2011
Posts: 1
mike ryan wrote:I was just looking at the users manual for the Drools Planner and it showed some of the methods used in it.Is pretty complex so i stopped looking at it to see if i can find my own possibly simpler way to do it as i think ,as you said mine will not need to be at first so complicated.


You could probably just copy-paste large parts of the nurse rostering example from Planner.

What makes Planner look complex? Would a "quick start" section in the reference manual help to distinguish between the base stuff and the advanced stuff?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
Welcome to the Ranch

It is surprising how concise and simple constraint programming code can look. Google for a tutorial and have a look.
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi Geoffrey,

Well i am still pretty new so allot of things look complex to me;) , but the main point is that i want to try to work it out on my own. It may be that in the end i will look closer at the Drools docs if i don't get anywhere on my own. I think it will take me a while just figuring out what i need to do on paper and then figure out how to put it all together.

I am guessing that you have done some work or working on this Software? If so stay tuned i will probably need your help ;)

Mike
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi,

So i am sitting here with a bit of free time and starting on my project. I have lots of paper and a pen/pencil at hand.AND... i am already stuck not knowing exactly how to do this lol.

I have so far started writing down all the things i can think of that i need. Is there any concrete way people begin a project? Or does everyone get there own flow over time? Just curious if there is some kind of "Rule of thumb" to follow here?
I can see already that there will be a problem with knowing what i will use for certain tasks, and what will make the most sense. For instance i have the employees, a few are full time and a few are part time . Do i use an Array? of just the names, then another class for full and part time? or do i make an array fullTime[], and an Array partTime[]; Should i even use an Array? hehe so i see this will be fun right from the beginning...

if anyone has a good rule of thumb to follow or some suggestions in general how you might go about this(keeping in mind i am a beginner). I was thinking to start just taking one single part and getting that done like the employees Class i suppose. Just figuring out how to put that, and the variables associated to the employee in some logical order.

things i know i need:

* Store hours are from 09:00 until 20:00

* 2 shifts 09:00 till 18:00 and 11:00 til 20:00

* full time employees work 8 hours a day (1 day off in a 6 day workweek mandatory).

* part time employees work minimum 87 hours per month max 40 hrs a week.(this depends on the time of year which i also need to somehow factor into this).

* part time must also have 1 day off in a 6 day workweek

* there must be at least 2 employees in the early shift and 2 in the late shift

* the store has alloted man hours for the month of 792hrs. (this can also change monthy)

* have to be able to add vacation dates in when they have been planned.(Vacation is not taken at any mandatory time but chosen by the employee)+(Vacation = 30 days a year which could possibly be controlled with this plan as well)

* meetings and such must also be able to be added same as vacation.

*employees must be able to be added or deleted as needed

that is all that i could think of at the moment, just so you get an idea , but is more than enough to keep me busy for now ;)

I have set my time limit to "when i retire" so i have like 22 years or so ...




Thanks
Mike
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18651
    
    8

Whoa, whoa! What do you mean, should you use an array?

You're talking about programming. You aren't nearly ready to do any programming. You don't even have a design yet. My suggestion would be to start by designing your data model. That would involve identifying classes (like maybe Employee, Shift, EmployeeShiftAssignment, and so on) and their attributes. Then you can design some processes which work with those objects and do things with them. When you do this you're bound to find attributes, or even classes, which you missed. Carry on until you have a coherent-looking design.

I would also recommend tossing out some the more complicated-looking requirements, or at least relegating them to a "Version 2" list. Do something very simple for Version 1 and make sure it works well before moving on. It's very likely that Version 2 will require modifying your data design, but that's normal in the systems development world, so don't be tempted to put things into your Version 1 design which won't be used until Version 2. Keep it simple to start with.
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi Paul,

Good advice thank you. OK i will try it like that first, will see if i get anywhere ;)

Thanks
Mike
Jon Byrum
Greenhorn

Joined: Sep 22, 2011
Posts: 1
We''ve tried to do something at Hello Scheduling a number of times in the past. This is a much more difficult problem than it sounds. At Hello Scheduling, employees get "tags" -- tags represent a skill that is required for the shift, like the ability to turn off the alarm -- and then our algorithm tries its best to take into account employee time preferences, shift "tag" requirements, vacation, etc. Incredibly difficult to do, and not for the faint of heart.
mike ryan
Ranch Hand

Joined: Aug 08, 2010
Posts: 210

Hi Jon,

Thanks for your input. And yes i figured before i even started this thread that it would be difficult, especially for a Beginner such as myself , but I think if i try it and make it really simple and have only a couple
preferences to begin with, even if i don't get it to work perfect it will still be a good learning experience for me, maybe a real headache as well hehe.
It may help me to understand how to implement algorithms or at least how to go about it(or how NOT to go about it ;) )

Thanks
Mike
oluwakemi mejabi
Greenhorn

Joined: Aug 01, 2013
Posts: 1
Wow this is like exactly what am trying to do for my final year project in school!!am still learning when it comes to java,but I have someone helping me through it,but I also need more help in the design,I have an idea of how the interface will be,but now my netbean IDE isn't functioning properly not sure why
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: new Project "automatic employee scheduling software", need some advice