当前位置: 首页>>代码示例>>Java>>正文


Java AvoidUnbalancedWhenNoExpectations类代码示例

本文整理汇总了Java中org.cpsolver.studentsct.online.expectations.AvoidUnbalancedWhenNoExpectations的典型用法代码示例。如果您正苦于以下问题:Java AvoidUnbalancedWhenNoExpectations类的具体用法?Java AvoidUnbalancedWhenNoExpectations怎么用?Java AvoidUnbalancedWhenNoExpectations使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AvoidUnbalancedWhenNoExpectations类属于org.cpsolver.studentsct.online.expectations包,在下文中一共展示了AvoidUnbalancedWhenNoExpectations类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOverExpectedCriterion

import org.cpsolver.studentsct.online.expectations.AvoidUnbalancedWhenNoExpectations; //导入依赖的package包/类
@Override
public OverExpectedCriterion getOverExpectedCriterion() {
	try {
           Class<OverExpectedCriterion> overExpectedCriterionClass = (Class<OverExpectedCriterion>)Class.forName(getConfig().getProperty("OverExpectedCriterion.Class", AvoidUnbalancedWhenNoExpectations.class.getName()));
           return overExpectedCriterionClass.getConstructor(DataProperties.class).newInstance(getConfig());
       } catch (Exception e) {
       	iLog.error("Unable to create custom over-expected criterion (" + e.getMessage() + "), using default.", e);
       	return new AvoidUnbalancedWhenNoExpectations(getConfig());
       }
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:11,代码来源:AbstractServer.java

示例2: OnlineSectioningModel

import org.cpsolver.studentsct.online.expectations.AvoidUnbalancedWhenNoExpectations; //导入依赖的package包/类
public OnlineSectioningModel(DataProperties properties) {
    super(properties);
    try {
        @SuppressWarnings("unchecked")
        Class<OverExpectedCriterion> overExpectedCriterionClass = (Class<OverExpectedCriterion>)
            Class.forName(properties.getProperty("OverExpectedCriterion.Class", AvoidUnbalancedWhenNoExpectations.class.getName()));
        iOverExpectedCriterion = overExpectedCriterionClass.getConstructor(DataProperties.class).newInstance(properties);
    } catch (Exception e) {
            sLog.error("Unable to create custom over-expected criterion (" + e.getMessage() + "), using default.", e);
            iOverExpectedCriterion = new PercentageOverExpected(properties);
    }
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:13,代码来源:OnlineSectioningModel.java

示例3: Test

import org.cpsolver.studentsct.online.expectations.AvoidUnbalancedWhenNoExpectations; //导入依赖的package包/类
public Test(DataProperties config) {
    iModel = new TestModel(config);
    iModel.setDistanceConflict(new DistanceConflict(new DistanceMetric(iModel.getProperties()), iModel.getProperties()));
    iModel.getDistanceConflict().register(iModel);
    iModel.getDistanceConflict().setAssignmentContextReference(iModel.createReference(iModel.getDistanceConflict()));
    iModel.setTimeOverlaps(new TimeOverlapsCounter(null, iModel.getProperties()));
    iModel.getTimeOverlaps().register(iModel);
    iModel.getTimeOverlaps().setAssignmentContextReference(iModel.createReference(iModel.getTimeOverlaps()));
    iModel.setStudentWeights(new StudentSchedulingAssistantWeights(iModel.getProperties()));
    iAssignment = new DefaultSingleAssignment<Request, Enrollment>();
    iSuggestions = "true".equals(System.getProperty("suggestions", iSuggestions ? "true" : "false"));

    String overexp = System.getProperty("overexp");
    if (overexp != null) {
        boolean bal = false;
        if (overexp.startsWith("b")) {
            bal = true;
            overexp = overexp.substring(1);
        }
        String[] x = overexp.split("[/\\-]");
        if (x.length == 1) {
            iModel.setOverExpectedCriterion(new PercentageOverExpected(Double.valueOf(x[0])));
        } else if (x.length == 2) {
            iModel.setOverExpectedCriterion(bal ? new AvoidUnbalancedWhenNoExpectations(Double.valueOf(x[0]), Double.valueOf(x[1]) / 100.0) :
                new FractionallyOverExpected(Double.valueOf(x[0]), Double.valueOf(x[1])));
        } else {
            iModel.setOverExpectedCriterion(new FractionallyUnbalancedWhenNoExpectations(Double.valueOf(x[0]),
                    Double.valueOf(x[1]), Double.valueOf(x[2]) / 100.0));
        }
    }

    sLog.info("Using " + (config.getPropertyBoolean("StudentWeights.MultiCriteria", true) ? "multi-criteria " : "")
            + (config.getPropertyBoolean("StudentWeights.PriorityWeighting", true) ? "priority" : "equal")
            + " weighting model" + " with over-expected " + iModel.getOverExpectedCriterion()
            + (iSuggestions ? ", suggestions" : "") + ", " + System.getProperty("sort", "shuffle") + " order"
            + " and " + config.getPropertyInt("Neighbour.BranchAndBoundTimeout", 1000) + " ms time limit.");
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:38,代码来源:Test.java


注:本文中的org.cpsolver.studentsct.online.expectations.AvoidUnbalancedWhenNoExpectations类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。