本文整理汇总了Java中com.sri.ai.expresso.helper.Expressions.INFINITY属性的典型用法代码示例。如果您正苦于以下问题:Java Expressions.INFINITY属性的具体用法?Java Expressions.INFINITY怎么用?Java Expressions.INFINITY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sri.ai.expresso.helper.Expressions
的用法示例。
在下文中一共展示了Expressions.INFINITY属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Categorical
/**
* Creates a categorical type of given name, cardinality and known constants;
* unknown constants, if requested, are named "<name>1", ... "<name>n",
* where name is the lower-case version of given name, and n is cardinality minus number of known constants.
* @param name
* @param cardinality number of elements in type (-1 if unknown, -2 if infinite)
* @param knownConstants
*/
public Categorical(String name, int cardinality, ArrayList<Expression> knownConstants) {
myAssert(
() -> cardinality == -1 || cardinality == -2 || knownConstants.size() <= cardinality,
() -> "Cardinality of " + name + " is declared to be less than number of known uniquely named constants");
this.name = name;
this.lowerCaseName = name.toLowerCase();
this.cardinality = cardinality;
if (cardinality == -1) {
this.cardinalityExpression = Expressions.UNKNOWN;
}
else if (cardinality == -2) {
this.cardinalityExpression = Expressions.INFINITY;
}
else {
this.cardinalityExpression = makeSymbol(cardinality);
}
this.knownConstants = knownConstants;
}
示例2: cardinality
@Override
public Expression cardinality() {
return Expressions.INFINITY;
}