-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/test/java/org/jacop/ConstraintStatusKnownAtImposition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.jacop; | ||
|
||
import org.jacop.constraints.ExtensionalConflictVA; | ||
import org.jacop.constraints.knapsack.Knapsack; | ||
import org.jacop.core.IntVar; | ||
import org.jacop.core.Store; | ||
import org.junit.Test; | ||
|
||
public class ConstraintStatusKnownAtImposition { | ||
|
||
@Test | ||
public void testSimpleFailSetupAtImpositionKnapsack() { | ||
|
||
Store store = new Store(); | ||
|
||
IntVar v0 = new IntVar(store, "v0", 1, 1); | ||
IntVar v1 = new IntVar(store, "v1", 0, 0); | ||
IntVar v2 = new IntVar(store, "v2", 1, 1); | ||
IntVar v3 = new IntVar(store, "v3", 0, 0); | ||
IntVar v4 = new IntVar(store, "v4", 0, 0); | ||
|
||
Knapsack cons = new Knapsack( | ||
new int[]{1, 2, 3}, | ||
new int[]{1, 2, 3}, | ||
new IntVar[]{v1, v2, v3}, | ||
v4, | ||
v0); | ||
|
||
store.impose(cons); | ||
|
||
} | ||
|
||
@Test | ||
public void testSimpleAlreadySatisfiedSetupAtImpositionConflictVA() { | ||
Store store = new Store (); | ||
|
||
IntVar v1 = new IntVar (store, "v1", 0, 0); | ||
IntVar v2 = new IntVar (store, "v2", 1, 1); | ||
|
||
ExtensionalConflictVA cons = new ExtensionalConflictVA ( | ||
new IntVar[] { v1, v2 }, | ||
new int[][] { | ||
new int[] {0, 0}, new int[] {1, 1} | ||
} | ||
); | ||
|
||
store.impose(cons); | ||
|
||
System.out.println(cons); | ||
System.out.println(store); | ||
|
||
store.consistency(); | ||
} | ||
|
||
|
||
} |
This file was deleted.
Oops, something went wrong.