当前位置: 首页>>代码示例>>Java>>正文


Java ESat类代码示例

本文整理汇总了Java中org.chocosolver.util.ESat的典型用法代码示例。如果您正苦于以下问题:Java ESat类的具体用法?Java ESat怎么用?Java ESat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ESat类属于org.chocosolver.util包,在下文中一共展示了ESat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@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;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:17,代码来源:PropSymmetryBreaking.java

示例2: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@Override
public ESat isEntailed() {
	try {
		if (!sortedEx()) {
			return ESat.FALSE;
		}
	} catch (ContradictionException e) {
		return ESat.FALSE;
	}
	for (BoolVar aT : t) {
		if (!aT.isInstantiated()) {
			return ESat.UNDEFINED;
		}
	}
	return ESat.TRUE;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:17,代码来源:PropSymmetryBreakingEx.java

示例3: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@Override
public ESat isEntailed() {
    int min = 0;
    int max = 0;
    for (int i = 0; i < n; i++) {
        ISet nei = g.getPotNeighOf(i);
        for (int j : nei) {
            if (i <= j) {
                max += distMatrix[i][j];
                if (g.getMandNeighOf(i).contains(j)) {
                    min += distMatrix[i][j];
                }
            }
        }
    }
    if (min > sum.getUB() || max < sum.getLB()) {
        return ESat.FALSE;
    }
    if (min == max) {
        return ESat.TRUE;
    } else {
        return ESat.UNDEFINED;
    }
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:25,代码来源:PropTreeCostSimple.java

示例4: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@Override
public ESat isEntailed() {
	if(g.getPotentialNodes().size()==1){
		return ESat.TRUE;
	}
	//Graphs with zero nodes are not connected.
	if(g.getMandatoryNodes().size() == 0){
		return ESat.FALSE;
	}
	explore();
	for(int i: g.getMandatoryNodes()){
		if(!visited.get(i)){
			return ESat.FALSE;
		}
	}
	if (!g.isInstantiated()) {
		return ESat.UNDEFINED;
	}

	return ESat.TRUE;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:22,代码来源:PropConnected.java

示例5: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@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;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:23,代码来源:PropNodeDegree_Var.java

示例6: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@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;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:18,代码来源:PropSymmetric.java

示例7: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@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;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:22,代码来源:PropNbLoops.java

示例8: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@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;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:18,代码来源:PropAntiSymmetric.java

示例9: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@Override
public ESat isEntailed() {
    int nbK = 0;
    int nbE = 0;
    ISet env = g.getPotentialNodes();
    for (int i : env) {
        nbE += g.getUB().getSuccOrNeighOf(i).size();
        nbK += g.getLB().getSuccOrNeighOf(i).size();
    }
    if (!g.isDirected()) {
        nbK /= 2;
        nbE /= 2;
    }
    if (nbK > k.getUB() || nbE < k.getLB()) {
        return ESat.FALSE;
    }
    if (k.isInstantiated() && g.isInstantiated()) {
        return ESat.TRUE;
    }
    return ESat.UNDEFINED;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:22,代码来源:PropNbArcs.java

示例10: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@Override
public ESat isEntailed() {
	int n = g.getNbMaxNodes();
	for (int i = 0; i < n; i++) {
		for (int j : g.getMandSuccOrNeighOf(i)) {
			if(i!=j){
				for (int j2 : g.getMandSuccOrNeighOf(j)) {
					if(j2!=i && !g.getPotSuccOrNeighOf(i).contains(j2)){
						return ESat.FALSE;
					}
				}
			}
		}
	}
	if (g.isInstantiated()) {
		return ESat.TRUE;
	}
	return ESat.UNDEFINED;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:20,代码来源:PropTransitivity.java

示例11: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@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)) {
				return ESat.FALSE;
			}
		}
	}
	if (isCompletelyInstantiated()) {
		return ESat.TRUE;
	}
	return ESat.UNDEFINED;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:21,代码来源:PropSuccIntsChannel1.java

示例12: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@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;
 }
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:23,代码来源:PropNeighIntsChannel2.java

示例13: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@Override
public ESat isEntailed() {
	for (int i = 0; i < n; i++) {
		for(int j=0;j<n;j++){
			if(matrix[i][j].getLB()==1 && !g.getPotSuccOrNeighOf(i).contains(j)) {
				return ESat.FALSE;
			} else if(matrix[i][j].getUB()==0 && g.getMandSuccOrNeighOf(i).contains(j)) {
				return ESat.FALSE;
			}
		}
	}
	if (isCompletelyInstantiated()) {
		return ESat.TRUE;
	}
	return ESat.UNDEFINED;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:17,代码来源:PropNeighBoolsChannel1.java

示例14: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@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;
}
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:21,代码来源:PropNeighIntsChannel1.java

示例15: isEntailed

import org.chocosolver.util.ESat; //导入依赖的package包/类
@Override
 public ESat isEntailed() {
     for (int i = 0; i < n; i++) {
for(int j=0;j<n;j++){
	if(matrix[i][j].getLB()==1 && !g.getPotSuccOrNeighOf(i).contains(j)){
		return ESat.FALSE;
	}else if(matrix[i][j].getUB()==0 && g.getMandSuccOrNeighOf(i).contains(j)){
		return ESat.FALSE;
	}
}
     }
     if (isCompletelyInstantiated()) {
         return ESat.TRUE;
     }
     return ESat.UNDEFINED;
 }
 
开发者ID:chocoteam,项目名称:choco-graph,代码行数:17,代码来源:PropNeighBoolsChannel2.java


注:本文中的org.chocosolver.util.ESat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。