Implement scheduling algorithms using Java

Have any of you ever dealt with job scheduling issues with Java? I have to work on the problem of resource planning with a limited resource and I want to ask for some practical advice. Are there any good libraries for implementing algorithms? What are the effective data structures that I should use?

change

It seems I did not explain it correctly. I want to solve the problem of resource planning with limited resources (RCPSP), which, as you know, is NP-complete with various heuristics. The task is defined as follows:

The project consists of the set A = {1, ..., n} of actions that must be performed on the set of resources R = {1, ..., m}. An action j ∈ A requires rjk ≥ 0 units of a resource k ∈ R for the entire time of its unsafe time pj ≥ 0. Each resource k ∈ R has a limited capacity Rk> 0. There are priority relations between actions, so one activity j ∈ A cannot be launched before all of its immediate predecessors run out. The goal is to find a possible priority and resource schedule that minimizes overall size.

+4
source share
5 answers

OpenSymphony Quartz Scheduller is the right tool for the task.

From the Quartz web page:

"What is quartz?

Quartz is a full-featured open-source job scheduling service that can be integrated or used by almost any Java EE or Java SE application — from the smallest standalone application to the largest e-commerce system. Quartz can be used to create simple or complex schedules for performing tens, hundreds or even tens of thousands of jobs; tasks whose tasks are defined as standard Java components that can be performed in almost everything that you can program for them. The Quartz Scheduler includes many enterprise-class features, such as JTA transactions and clustering.

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

Read our review for faster information.

+1
source

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

+1
source

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

edit: glpk actually comes with its own modeling language, which is just a subset of AMPL, which will probably make things easier.

+1
source

There are several libraries for complete NP planning tasks: Drools Planner (open source, ASL java), JGap, cpsolver, opents, ...

+1
source

You can use backSolver to solve this problem using the finite capacity planning model.

0
source

All Articles