本文整理汇总了Java中org.chocosolver.util.ESat.TRUE属性的典型用法代码示例。如果您正苦于以下问题:Java ESat.TRUE属性的具体用法?Java ESat.TRUE怎么用?Java ESat.TRUE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.chocosolver.util.ESat
的用法示例。
在下文中一共展示了ESat.TRUE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isEntailed
@Override
public ESat isEntailed() {
ISet ker = g.getMandatoryNodes();
ISet succ;
for (int i : ker) {
succ = g.getMandSuccOf(i);
for (int j : succ) {
if (g.getMandSuccOf(j).contains(i)) {
return ESat.FALSE;
}
}
}
if (g.isInstantiated()) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例2: isEntailed
@Override
public ESat isEntailed() {
try {
if (!sorted()) {
return ESat.FALSE;
}
} catch (ContradictionException e) {
return ESat.FALSE;
}
for (BoolVar aT : t) {
if (!aT.isInstantiated()) {
return ESat.UNDEFINED;
}
}
return ESat.TRUE;
}
示例3: isEntailed
@Override
public ESat isEntailed() {
for (int i = 0; i < n; i++) {
if(succs[i].isInstantiated()){
if (!g.getPotNeighOf(i).contains(succs[i].getValue())) {
return ESat.FALSE;
}
}
ISet tmp = g.getMandNeighOf(i);
for (int j : tmp) {
if ((!succs[i].contains(j)) && (!succs[j].contains(i))) {
return ESat.FALSE;
}
}
}
if (isCompletelyInstantiated()) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例4: isEntailed
@Override
public ESat isEntailed() {
ISet ker = g.getMandatoryNodes();
ISet succ;
for (int i : ker) {
succ = g.getMandSuccOf(i);
for (int j : succ) {
if (!g.getPotSuccOf(j).contains(i)) {
return ESat.FALSE;
}
}
}
if (g.isInstantiated()) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例5: isEntailed
@Override
public ESat isEntailed() {
boolean done = true;
for(int i=0;i<n;i++){
if((!degrees[i].contains(0)) && !g.getPotentialNodes().contains(i)){
return ESat.FALSE;
}
ISet env = target.getPotSet(g, i);
ISet ker = target.getMandSet(g, i);
if(degrees[i].getLB()>env.size()
|| degrees[i].getUB()<ker.size()){
return ESat.FALSE;
}
if(env.size() != ker.size() || !degrees[i].isInstantiated()){
done = false;
}
}
if (!done) {
return ESat.UNDEFINED;
}
return ESat.TRUE;
}
示例6: isEntailed
@Override
public ESat isEntailed() {
for (int i = 0; i < n; i++) {
if(succs[i].isInstantiated()){
if (!g.getPotSuccOrNeighOf(i).contains(succs[i].getValue())) {
return ESat.FALSE;
}
}
ISet tmp = g.getMandSuccOrNeighOf(i);
for (int j : tmp) {
if (!succs[i].contains(j)) {
if(g.isDirected() || !succs[j].contains(i)) {
return ESat.FALSE;
}
}
}
}
if (isCompletelyInstantiated()) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例7: isEntailed
@Override
public ESat isEntailed() {
int min = 0;
int max = 0;
ISet env = g.getPotentialNodes();
for (int i : env) {
if (g.getMandSuccOrNeighOf(i).contains(i)) {
min++;
max++;
} else if (g.getPotSuccOrNeighOf(i).contains(i)) {
max++;
}
}
if (k.getLB() > max || k.getUB() < min) {
return ESat.FALSE;
}
if (min == max) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例8: solve
public boolean solve() {
if (solver != null) {
System.out.println("Running choco solver ...");
logger.log(Level.INFO, "Running Choco Solver ...");
solver.findSolution();
logger.log(Level.INFO, "end running Choco Solver ");
if (solver.isFeasible() == ESat.TRUE) {
solution = new ArrayList<String>();
for (int i = 0; i < vars.length; i++) {
int var = vars[i].getValue();
Value input = inputs.get(i).value;
if (input instanceof janala.interpreters.StringValue) {
solution.add(StringConstants.instance.get(var));
} else {
solution.add(Integer.toString(var));
}
}
return true;
} else {
logger.log(Level.INFO, "-- Infeasible");
return false;
}
}
return false;
}
示例9: isEntailed
@Override
public ESat isEntailed() {
ISet nodes = g.getMandatoryNodes();
for (int i : nodes) {
if (g.getMandNeighOf(i).size() > 2 || g.getPotNeighOf(i).size() < 2) {
return ESat.FALSE;
}
}
if (g.isInstantiated()) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例10: isEntailed
@Override
public ESat isEntailed() {
int upperGraphGirth = getUpperGraphGirth();
int lowerGraphGirth = getLowerGraphGirth();
if (upperGraphGirth < girth.getLB()) {
return ESat.FALSE;
}
if (lowerGraphGirth > girth.getUB()) {
return ESat.FALSE;
}
if (graph.isInstantiated() && girth.isInstantiatedTo(lowerGraphGirth)) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例11: isEntailed
@Override
public ESat isEntailed() {
int env = g.getPotentialNodes().size();
int ker = g.getMandatoryNodes().size();
if (env < k.getLB() || ker > k.getUB()) {
return ESat.FALSE;
}
if (env == ker) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例12: isEntailed
@Override
public ESat isEntailed() {
if (k.getUB() < minCC() || k.getLB()>maxCC()) {
return ESat.FALSE;
}
if (isCompletelyInstantiated()) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例13: isEntailed
@Override
public ESat isEntailed() {
if (g.getPotentialNodes().size() == g.getMandatoryNodes().size()){
return ESat.UNDEFINED;
}
if (!env_CC_finder.isBiconnected()) {
return ESat.FALSE;
}
if (g.isInstantiated()) {
return ESat.TRUE;
}
return ESat.UNDEFINED;
}
示例14: isEntailed
@Override
public ESat isEntailed() {
System.out.println("[WARNING] "+this.getClass().getSimpleName()+".isEntail() is not implemented yet " +
"and returns true by default. Please do not reify this constraint ");
return ESat.TRUE;
}
示例15: isEntailed
@Override
public ESat isEntailed() {
return ESat.TRUE;
}