本文整理汇总了Java中org.cpsolver.studentsct.online.OnlineConfig类的典型用法代码示例。如果您正苦于以下问题:Java OnlineConfig类的具体用法?Java OnlineConfig怎么用?Java OnlineConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnlineConfig类属于org.cpsolver.studentsct.online包,在下文中一共展示了OnlineConfig类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEnrollment
import org.cpsolver.studentsct.online.OnlineConfig; //导入依赖的package包/类
/**
* Config enrollment (using {@link OnlineConfig#getEnrollment()} if applicable}, {@link Config#getEnrollmentWeight(Assignment, Request)} otherwise)
* @param assignment current assignment
* @param config given configuration
* @param request given request
* @return current enrollment of the section, excluding the request
*/
protected double getEnrollment(Assignment<Request, Enrollment> assignment, Config config, Request request) {
if (config instanceof OnlineConfig) {
return ((OnlineConfig) config).getEnrollment();
} else {
return config.getEnrollmentWeight(assignment, request);
}
}
示例2: getLimit
import org.cpsolver.studentsct.online.OnlineConfig; //导入依赖的package包/类
/**
* Subpart limit (using {@link OnlineConfig#getEnrollment()} if applicable}, {@link Subpart#getLimit()} otherwise)
* @param subpart given subpart
* @return limit of the given subpart
*/
protected int getLimit(Subpart subpart) {
int limit = subpart.getLimit();
if (limit < 0)
return limit;
if (subpart.getConfig() instanceof OnlineConfig)
limit += ((OnlineConfig) subpart.getConfig()).getEnrollment();
return limit;
}