本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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));
}
示例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;
}
示例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)
);
}
示例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);
}
示例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);
}
}
}
示例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));
}
};
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}