Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 990
martin Avatar asked Oct 13 '22 23:10

martin


2 Answers

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."

like image 122
Boris Pavlović Avatar answered Nov 01 '22 18:11

Boris Pavlović


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

like image 20
Dewfy Avatar answered Nov 01 '22 16:11

Dewfy