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


Java DataProperties.getPropertyInt方法代码示例

本文整理汇总了Java中org.cpsolver.ifs.util.DataProperties.getPropertyInt方法的典型用法代码示例。如果您正苦于以下问题:Java DataProperties.getPropertyInt方法的具体用法?Java DataProperties.getPropertyInt怎么用?Java DataProperties.getPropertyInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.cpsolver.ifs.util.DataProperties的用法示例。


在下文中一共展示了DataProperties.getPropertyInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: naive

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public void naive(DataProperties cfg, Assignment<CurVariable, CurValue> assignment) {
  	int maxIdle = cfg.getPropertyInt("Curriculum.Naive.MaxIdle", 1000);
  	sLog.debug("  -- running naive");
int idle = 0, it = 0;
double best = getTotalValue(assignment);
CurStudentSwap sw = new CurStudentSwap(cfg);
Solution<CurVariable, CurValue> solution = new Solution<CurVariable, CurValue>(this, assignment);
while (!getSwapCourses().isEmpty() && idle < maxIdle && canContinue()) {
	Neighbour<CurVariable, CurValue> n = sw.selectNeighbour(solution);
	if (n == null) break;
	double value = n.value(assignment);
	if (value < -0.00001) {
		idle = 0;
		n.assign(assignment, it);
	} else if (value <= 0.0) {
		n.assign(assignment, it);
	}
	if (getTotalValue(assignment) < best) {
		best = getTotalValue(assignment);
		sLog.debug("  -- best value: " + toString(assignment));
	}
	it++; idle++;
}
sLog.debug("  -- final value: " + toString(assignment));
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:26,代码来源:CurModel.java

示例2: EnrollmentSelection

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param properties
 *            input configuration
 */
public EnrollmentSelection(DataProperties properties) {
    iMPP = properties.getPropertyBoolean("General.MPP", false);
    if (iMPP) {
        iMPPLimit = properties.getPropertyInt("Value.MPPLimit", -1);
        iInitialSelectionProb = properties.getPropertyDouble("Value.InitialSelectionProb", 0.75);
        iWeightDeltaInitialAssignment = properties.getPropertyDouble("Value.WeightDeltaInitialAssignments", 0.0);
    }
    iGoodSelectionProb = properties.getPropertyDouble("Value.GoodSelectionProb", 0.00);
    iWeightWeightedCoflicts = properties.getPropertyDouble("Value.WeightWeightedConflicts", 1.0);
    iWeightPotentialConflicts = properties.getPropertyDouble("Value.WeightPotentialConflicts", 0.0);

    iRandomWalkProb = properties.getPropertyDouble("Value.RandomWalkProb", 0.0);
    iWeightCoflicts = properties.getPropertyDouble("Value.WeightConflicts", 1.0);
    iWeightValue = properties.getPropertyDouble("Value.WeightValue", 0.0);
    iTabuSize = properties.getPropertyInt("Value.Tabu", 0);
    if (iTabuSize > 0)
        iTabu = new ArrayList<Enrollment>(iTabuSize);
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:25,代码来源:EnrollmentSelection.java

示例3: BranchBoundSelection

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param properties
 *            configuration
 */
public BranchBoundSelection(DataProperties properties) {
    iTimeout = properties.getPropertyInt("Neighbour.BranchAndBoundTimeout", iTimeout);
    iMinimizePenalty = properties.getPropertyBoolean("Neighbour.BranchAndBoundMinimizePenalty", iMinimizePenalty);
    if (iMinimizePenalty)
        sLog.info("Overall penalty is going to be minimized (together with the maximization of the number of assigned requests and minimization of distance conflicts).");
    if (properties.getProperty("Neighbour.BranchAndBoundOrder") != null) {
        try {
            iOrder = (StudentOrder) Class.forName(properties.getProperty("Neighbour.BranchAndBoundOrder"))
                    .getConstructor(new Class[] { DataProperties.class }).newInstance(new Object[] { properties });
        } catch (Exception e) {
            sLog.error("Unable to set student order, reason:" + e.getMessage(), e);
        }
    }
    iDistConfWeight = properties.getPropertyDouble("DistanceConflict.Weight", iDistConfWeight);
    iBranchWhenSelectedHasNoConflict = properties.getPropertyBoolean("Students.BranchWhenSelectedHasNoConflict", iBranchWhenSelectedHasNoConflict);
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:23,代码来源:BranchBoundSelection.java

示例4: fast

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public void fast(DataProperties cfg, Assignment<CurVariable, CurValue> assignment) {
  	int maxIdle = cfg.getPropertyInt("Curriculum.Fast.MaxIdle", 1000);
  	sLog.debug("  -- running fast");
int idle = 0, it = 0;
double total = getTotalValue(assignment);
double best = total;
CurSimpleMove m = new CurSimpleMove(cfg);
Solution<CurVariable, CurValue> solution = new Solution<CurVariable, CurValue>(this, assignment);
while (idle < maxIdle && canContinue()) {
	Neighbour<CurVariable, CurValue> n = m.selectNeighbour(solution);
  		if (n != null) {
      		double value = n.value(assignment);
  			if (value < -0.00001) {
  				idle = 0;
			n.assign(assignment, it);
  				total += value;
  			} else if (value <= 0.0) {
			n.assign(assignment, it);
  			}
  		}
	if (total < best) {
		best = total;
		sLog.debug("  -- best value: " + toString(assignment));
	}
	it++; idle++;
}
sLog.debug("  -- final value: " + toString(assignment));
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:29,代码来源:CurModel.java

示例5: DepartmentSpreadConstraint

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public DepartmentSpreadConstraint(DataProperties config, Long department, String name) {
    super(name,
            config.getPropertyDouble("DeptBalancing.SpreadFactor", 1.20),
            config.getPropertyInt("DeptBalancing.Unassignments2Weaken", 250),
            config.getPropertyBoolean("General.InteractiveMode", false),
            config.getPropertyInt("General.FirstDaySlot", Constants.DAY_SLOTS_FIRST),
            config.getPropertyInt("General.LastDaySlot", Constants.DAY_SLOTS_LAST),
            config.getPropertyInt("General.FirstWorkDay", 0),
            config.getPropertyInt("General.LastWorkDay", Constants.NR_DAYS_WEEK - 1)
            );
    iDepartment = department;
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:13,代码来源:DepartmentSpreadConstraint.java

示例6: SpreadConstraint

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public SpreadConstraint(DataProperties config, String name) {
    this(name,
            config.getPropertyDouble("Spread.SpreadFactor", 1.20),
            config.getPropertyInt("Spread.Unassignments2Weaken", 250),
            config.getPropertyBoolean("General.InteractiveMode", false),
            config.getPropertyInt("General.FirstDaySlot", Constants.DAY_SLOTS_FIRST),
            config.getPropertyInt("General.LastDaySlot", Constants.DAY_SLOTS_LAST),
            config.getPropertyInt("General.FirstWorkDay", 0),
            config.getPropertyInt("General.LastWorkDay", Constants.NR_DAYS_WEEK - 1)
            );
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:12,代码来源:SpreadConstraint.java

示例7: configure

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
@Override
public void configure(DataProperties properties) {
    super.configure(properties);

    iWeight = properties.getPropertyDouble("InstructorLunch.Weight", 0.3d);

    // lunch parameters
    iLunchStart = properties.getPropertyInt("InstructorLunch.StartSlot", (11 * 60) / 5);
    iLunchEnd = properties.getPropertyInt("InstructorLunch.EndSlot", (13 * 60 + 30) / 5);
    iLunchLength = properties.getPropertyInt("InstructorLunch.Length", 30 / 5);
    iMultiplier = properties.getPropertyDouble("InstructorLunch.Multiplier", 1.2d);
    iFullInfo = properties.getPropertyBoolean("InstructorLunch.InfoShowViolations", false);
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:14,代码来源:InstructorLunchBreak.java

示例8: SwapStudentSelection

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param properties
 *            configuration
 */
public SwapStudentSelection(DataProperties properties) {
    iTimeout = properties.getPropertyInt("Neighbour.SwapStudentsTimeout", iTimeout);
    iMaxValues = properties.getPropertyInt("Neighbour.SwapStudentsMaxValues", iMaxValues);
    if (properties.getProperty("Neighbour.SwapStudentsOrder") != null) {
        try {
            iOrder = (StudentOrder) Class.forName(properties.getProperty("Neighbour.SwapStudentsOrder"))
                    .getConstructor(new Class[] { DataProperties.class }).newInstance(new Object[] { properties });
        } catch (Exception e) {
            sLog.error("Unable to set student order, reason:" + e.getMessage(), e);
        }
    }
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:19,代码来源:SwapStudentSelection.java

示例9: SuggestionsBranchAndBound

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
/**
 * Constructor 
 * @param properties configuration
 * @param student given student
 * @param assignment current assignment
 * @param requiredSections required sections
 * @param requiredFreeTimes required free times (free time requests that must be assigned)
 * @param preferredSections preferred sections
 * @param selectedRequest selected request
 * @param selectedSection selected section
 * @param filter section filter
 * @param maxSectionsWithPenalty maximal number of sections that have a positive over-expectation penalty {@link OverExpectedCriterion#getOverExpected(Assignment, Section, Request)}
 */
public SuggestionsBranchAndBound(DataProperties properties, Student student,
        Assignment<Request, Enrollment> assignment, Hashtable<CourseRequest, Set<Section>> requiredSections,
        Set<FreeTimeRequest> requiredFreeTimes, Hashtable<CourseRequest, Set<Section>> preferredSections,
        Request selectedRequest, Section selectedSection, SuggestionFilter filter, double maxSectionsWithPenalty) {
    iRequiredSections = requiredSections;
    iRequiredFreeTimes = requiredFreeTimes;
    iPreferredSections = preferredSections;
    iSelectedRequest = selectedRequest;
    iSelectedSection = selectedSection;
    iStudent = student;
    iModel = (OnlineSectioningModel) selectedRequest.getModel();
    iAssignment = assignment;
    iMaxDepth = properties.getPropertyInt("Suggestions.MaxDepth", iMaxDepth);
    iTimeout = properties.getPropertyLong("Suggestions.Timeout", iTimeout);
    iMaxSuggestions = properties.getPropertyInt("Suggestions.MaxSuggestions", iMaxSuggestions);
    iMaxSectionsWithPenalty = maxSectionsWithPenalty;
    iFilter = filter;
    iComparator = new SelectionComparator() {
        private HashMap<Enrollment, Double> iValues = new HashMap<Enrollment, Double>();

        private Double value(Enrollment e) {
            Double value = iValues.get(e);
            if (value == null) {
                value = iModel.getStudentWeights().getWeight(iAssignment, e,
                        (iModel.getDistanceConflict() == null ? null : iModel.getDistanceConflict().conflicts(e)),
                        (iModel.getTimeOverlaps() == null ? null : iModel.getTimeOverlaps().conflicts(e)));
                iValues.put(e, value);
            }
            return value;
        }

        @Override
        public int compare(Assignment<Request, Enrollment> a, Enrollment e1, Enrollment e2) {
            return value(e2).compareTo(value(e1));
        }
    };
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:51,代码来源:SuggestionsBranchAndBound.java

示例10: ConflictStatistics

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public ConflictStatistics(Solver<V, T> solver, DataProperties properties) {
    super(solver, properties);
    iAgeing = properties.getPropertyDouble(PARAM_AGEING, iAgeing);
    int halfAge = properties.getPropertyInt(PARAM_HALF_AGE, 0);
    if (halfAge > 0)
        iAgeing = Math.exp(Math.log(0.5) / (halfAge));
    iPrint = properties.getPropertyBoolean(PARAM_PRINT, iPrint);
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:9,代码来源:ConflictStatistics.java

示例11: MPPTerminationCondition

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public MPPTerminationCondition(DataProperties properties) {
    iMaxIter = properties.getPropertyInt("Termination.MaxIters", -1);
    iTimeOut = properties.getPropertyDouble("Termination.TimeOut", -1.0);
    iMinPerturbances = properties.getPropertyInt("Termination.MinPerturbances", -1);
    iStopWhenComplete = properties.getPropertyBoolean("Termination.StopWhenComplete", false);
    iMinPertPenalty = properties.getPropertyDouble("Termination.MinPerturbationPenalty", -1.0);
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:8,代码来源:MPPTerminationCondition.java

示例12: DbtValueSelection

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public DbtValueSelection(DataProperties properties) {
    iMPP = properties.getPropertyBoolean("General.MPP", false);

    if (iMPP) {
        iMPPLimit = properties.getPropertyInt("Value.MPPLimit", -1);
        iInitialSelectionProb = properties.getPropertyDouble("Value.InitialSelectionProb", 0.75);
        iWeightDeltaInitialAssignment = properties.getPropertyDouble("Value.WeightDeltaInitialAssignments", 0.0);
    }

    iRandomWalkProb = properties.getPropertyDouble("Value.RandomWalkProb", 0.0);
    iWeightValue = properties.getPropertyDouble("Value.WeightValue", 0.0);
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:13,代码来源:DbtValueSelection.java

示例13: CurTermination

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public CurTermination(DataProperties properties) {
    iMaxIter = properties.getPropertyInt("Termination.MaxIters", -1);
    iTimeOut = properties.getPropertyDouble("Termination.TimeOut", -1.0);
    iStopWhenComplete = properties.getPropertyBoolean("Termination.StopWhenComplete", false);
    iMaxIdle = properties.getPropertyLong("Termination.MaxIdle", 10000);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:7,代码来源:CurTermination.java

示例14: MinimizeNumberOfUsedGroupsOfTime

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public MinimizeNumberOfUsedGroupsOfTime(DataProperties config, String name, GroupOfTime[] groupsOfTime) {
    iGroupsOfTime = groupsOfTime;
    iUnassignmentsToWeaken = config.getPropertyInt("MinimizeNumberOfUsedGroupsOfTime.Unassignments2Weaken", iUnassignmentsToWeaken);
    iName = name;
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:6,代码来源:MinimizeNumberOfUsedGroupsOfTime.java

示例15: configure

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
@Override
public void configure(DataProperties properties) {   
    super.configure(properties);
    iLargeSize = properties.getPropertyInt("Exams.LargeSize", iLargeSize);
    iLargePeriod = properties.getPropertyDouble("Exams.LargePeriod", iLargePeriod);
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:7,代码来源:LargeExamsPenalty.java


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