當前位置: 首頁>>代碼示例>>Java>>正文


Java Expressions.INFINITY屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:aic-sri-international,項目名稱:aic-expresso,代碼行數:26,代碼來源:Categorical.java

示例2: cardinality

@Override
public Expression cardinality() {
	return Expressions.INFINITY;
}
 
開發者ID:aic-sri-international,項目名稱:aic-expresso,代碼行數:4,代碼來源:IntegerExpressoType.java


注:本文中的com.sri.ai.expresso.helper.Expressions.INFINITY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。