martin
martin

Reputation: 775

Implementing Scheduling Algorithms with Java

has anyone of you ever dealt with job scheduling problems with Java? I have to work on a resource-constrained project scheduling problem and want to ask for some practical tips. Are there any good libs available for implementing algorithms? What are efficient data structures I should use?

edit:

It seems like i have not explained it right. I want to solve the resource-constrained project scheduling problem (RCPSP) which is known to be NP-complete with different heuristics. The problem is defined as follows:

A project consists of a set A = {1, ..., n} of activities, which must be performed on a set R = {1, ..., m} of resources. An activity j ∈ A requires rjk ≥ 0 units of resource k ∈ R throughout its non-preemptible processing time pj ≥ 0. Each resource k ∈ R has a limited capacity Rk > 0. There exists precedence relations between the activities, such that one activity j ∈ A can not be started before all its immediate predecessors have completed. The objective is to find a precedence and resource-capacity feasible schedule which minimizes the overall makespan.

Upvotes: 5

Views: 5424

Answers (5)

Federico Dal Maso
Federico Dal Maso

Reputation: 408

You can use backSolver to solve this problem, using the finite capacity scheduling model

Upvotes: 0

Geoffrey De Smet
Geoffrey De Smet

Reputation: 27312

There are a couple of libs for NP complete planning problems out there: Drools Planner (open source, ASL java), JGap, cpsolver, opents, ...

Upvotes: 1

fairidox
fairidox

Reputation: 3428

AMPL is a modeling language that you can use for this, it can be compiled into a mixed integer linear program and solved with a number of solvers. I would suggest the GNU MathProg modeling language, it is a subset of the AMPL language and you can use it with the GLPK solver. This is a very common problem and you will probably be able to find a example very close to what you want to do.

edit: actually glpk comes with it's own modeling language which is just a subset of AMPL, which would likely make things easier.

Upvotes: 1

Dewfy
Dewfy

Reputation: 23624

JDK 1.6 already have very good one. look at java.util.concurrent.ScheduledThreadPoolExecutor

Upvotes: 1

Boris Pavlović
Boris Pavlović

Reputation: 64632

OpenSymphony Quartz Scheduller is the right tool for the task.

From Quartz's web page:

"What is Quartz?

Quartz is a full-featured, open source job scheduling service that can be integrated with, or used along side virtually any Java EE or Java SE application - from the smallest stand-alone application to the largest e-commerce system. Quartz can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components that may executed virtually anything you may program them to do. The Quartz Scheduler includes many enterprise-class features, such as JTA transactions and clustering.

Quartz is freely usable, licensed under the Apache 2.0 license.

Please read our overview for more quick information."

Upvotes: 1

Related Questions