本文整理匯總了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;
}