question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cumulative constraint not able to prune more complex tasks

See original GitHub issue

I have 4 tasks. As I am scheduling jobs, I am instantiating them from lower bound. First I place A. Then I place B, but the placement fails. Then there are len(A) - len(B) iterations where B is placed

Expected behavior

image

Actual behavior

image

Minimal Working Example

Experienced with choco-solver-{3.3.3 - 4.0.5}

public class BasicPlayground {
	public final static int MAXTIME = 10000;
	
	public static void main(String[] args) {
		Model model = new Model();

		TTask a = new TTask("taskA", model, 800);
		TTask b = new TTask("taskB", model, 10);
		TTask c = new TTask("taskC", model, 10);
		TTask d = new TTask("taskC", model, 10);
		
		model.post(model.arithm(b.getEnd(), "=", c.getStart()),
				model.arithm(b.getEnd(), "=", d.getStart()),
				model.cumulative(
						new Task[]{a.getTask(), b.getTask(), c.getTask(), d.getTask()},
						model.intVarArray("", 4, 1, 1),
						model.intVar(2),
						false,
						Cumulative.Filter.HEIGHTS)
		);
		
		
		Solver solver = model.getSolver();
		solver.setSearch(Search.minDomLBSearch(a.getStart(), b.getStart(), c.getStart(), d.getStart()));
		Solution solution = solver.findSolution();
		solver.printStatistics();
	}	
}

@Data
class TTask {
	private final IntVar start;
	private final IntVar end;
	private final IntVar duration;
	private final Task task;
	
	public TTask(String taskName, Model model, int iduration) {
		this.start = model.intVar(taskName + " start", 0, BasicPlayground.MAXTIME);
		this.end = model.intVar(taskName + " end", 0, BasicPlayground.MAXTIME);
		this.duration = model.intVar(taskName + " duration", iduration, iduration);
		this.task = model.taskVar(start, duration, end);
	}
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jgFagescommented, Oct 11, 2017

its what i say, disjunctive is for capacity 1, so you should NOT manually use DisjunctiveTaskIntervalFilter if capacity is not equal to 1

0reactions
jgFagescommented, Oct 12, 2017

Absolutely!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Global Constraint Catalog: Ccumulative
Purpose. Cumulative scheduling constraint or scheduling under resource constraints. Consider a set T of tasks described by the 𝚃𝙰𝚂𝙺𝚂 collection.
Read more >
The SoftCumulative Constraint with Quadratic Penalty
The constraint uses one starting time variable Si ∈ [esti, lsti] for each task i in the problem, as well as parameters for...
Read more >
A New Multi-Resource cumulatives Constraint with Negative ...
Abstract. This paper presents a new s cumulative constraint which generalizes the original cumulative constraint in different ways.
Read more >
A new constraint programming model and solving for the ...
Thus cumulative only has a lower bound on the duration and is unlikely to achieve substantial additional pruning to justify its overhead.
Read more >
[PDF] Explaining the cumulative propagator - ResearchGate
PDF | The global cumulative constraint was proposed for modelling ... represent not only a machine which is able to run multiple tasks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found