当前位置: 首页>>代码示例>>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;未经允许,请勿转载。