本文整理汇总了Java中org.cpsolver.ifs.util.DataProperties.getPropertyBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java DataProperties.getPropertyBoolean方法的具体用法?Java DataProperties.getPropertyBoolean怎么用?Java DataProperties.getPropertyBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cpsolver.ifs.util.DataProperties
的用法示例。
在下文中一共展示了DataProperties.getPropertyBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CurriculaRequestsCourseDemands
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public CurriculaRequestsCourseDemands(DataProperties config) {
iProperties = config;
iStudentCourseRequests = new StudentCourseRequests(config);
iIncludeOtherStudents = config.getPropertyBoolean("CurriculaCourseDemands.IncludeOtherStudents", iIncludeOtherStudents);
iIncludeOtherCourses = config.getPropertyBoolean("CurriculaCourseDemands.IncludeOtherCourses", config.getPropertyBoolean("CurriculaCourseDemands.IncludeOtherStudents", iIncludeOtherCourses));
iSetStudentCourseLimits = config.getPropertyBoolean("CurriculaCourseDemands.SetStudentCourseLimits", iSetStudentCourseLimits);
iCreateStudentGroups = config.getPropertyBoolean("CurriculaCourseDemands.CreateStudentGroups", iCreateStudentGroups);
iEnrollmentPriorityProvider = new DefaultCurriculumEnrollmentPriorityProvider(config);
if (config.getProperty("CurriculaCourseDemands.CurriculumEnrollmentPriorityProvider") != null) {
try {
iEnrollmentPriorityProvider = (CurriculumEnrollmentPriorityProvider)Class.forName(
config.getProperty("CurriculaCourseDemands.CurriculumEnrollmentPriorityProvider"))
.getConstructor(DataProperties.class).newInstance(config);
} catch (Exception e) {
sLog.error("Failed to use custom enrollment priority provider: " + e.getMessage(), e);
}
}
}
示例2: CurriculaLastLikeCourseDemands
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public CurriculaLastLikeCourseDemands(DataProperties config) {
iProperties = config;
iProjectedDemands = new ProjectedStudentCourseDemands(config);
iIncludeOtherStudents = config.getPropertyBoolean("CurriculaCourseDemands.IncludeOtherStudents", iIncludeOtherStudents);
iIncludeOtherCourses = config.getPropertyBoolean("CurriculaCourseDemands.IncludeOtherCourses", config.getPropertyBoolean("CurriculaCourseDemands.IncludeOtherStudents", iIncludeOtherCourses));
iSetStudentCourseLimits = config.getPropertyBoolean("CurriculaCourseDemands.SetStudentCourseLimits", iSetStudentCourseLimits);
iCreateStudentGroups = config.getPropertyBoolean("CurriculaCourseDemands.CreateStudentGroups", iCreateStudentGroups);
iEnrollmentPriorityProvider = new DefaultCurriculumEnrollmentPriorityProvider(config);
if (config.getProperty("CurriculaCourseDemands.CurriculumEnrollmentPriorityProvider") != null) {
try {
iEnrollmentPriorityProvider = (CurriculumEnrollmentPriorityProvider)Class.forName(
config.getProperty("CurriculaCourseDemands.CurriculumEnrollmentPriorityProvider"))
.getConstructor(DataProperties.class).newInstance(config);
} catch (Exception e) {
sLog.error("Failed to use custom enrollment priority provider: " + e.getMessage(), e);
}
}
}
示例3: CurriculaCourseDemands
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public CurriculaCourseDemands(DataProperties properties) {
iProperties = properties;
if (properties != null)
iFallback = new ProjectedStudentCourseDemands(properties);
iIncludeOtherStudents = properties.getPropertyBoolean("CurriculaCourseDemands.IncludeOtherStudents", iIncludeOtherStudents);
iSetStudentCourseLimits = properties.getPropertyBoolean("CurriculaCourseDemands.SetStudentCourseLimits", iSetStudentCourseLimits);
iCreateStudentGroups = properties.getPropertyBoolean("CurriculaCourseDemands.CreateStudentGroups", iCreateStudentGroups);
iEnrollmentPriorityProvider = new DefaultCurriculumEnrollmentPriorityProvider(properties);
if (properties.getProperty("CurriculaCourseDemands.CurriculumEnrollmentPriorityProvider") != null) {
try {
iEnrollmentPriorityProvider = (CurriculumEnrollmentPriorityProvider)Class.forName(
properties.getProperty("CurriculaCourseDemands.CurriculumEnrollmentPriorityProvider"))
.getConstructor(DataProperties.class).newInstance(properties);
} catch (Exception e) {
sLog.error("Failed to use custom enrollment priority provider: " + e.getMessage(), e);
}
}
}
示例4: 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);
}
示例5: GeneralValueSelection
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
/**
* Constructor
*
* @param properties
* input configuration
*/
public GeneralValueSelection(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<T>(iTabuSize);
}
示例6: 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);
}
示例7: 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);
}
示例8: main
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
/**
* RPP test.
*
* @param args
* the command line arguments
*/
public static void main(String[] args) {
try {
Progress.getInstance().addProgressListener(new ProgressWriter(System.out));
File inputCfg = new File(args[0]);
DataProperties properties = ToolBox.loadProperties(inputCfg);
if (properties.getProperty("INCLUDE_REGEXP") != null) {
if (args.length > 1)
properties.setProperty("General.Output", args[1]);
test(inputCfg, null, null, properties.getProperty("INCLUDE_REGEXP"), (args.length > 1 ? args[1] : null));
} else {
String outDir = properties.getProperty("General.Output", ".") + File.separator
+ inputCfg.getName().substring(0, inputCfg.getName().lastIndexOf('.')) + File.separator
+ sDateFormat.format(new Date());
if (args.length > 1)
outDir = args[1] + File.separator + (sDateFormat.format(new Date()));
(new File(outDir)).mkdirs();
properties.setProperty("General.Output", outDir.toString());
System.out.println("Output folder: " + properties.getProperty("General.Output"));
ToolBox.configureLogging(outDir, null);
boolean mpp = properties.getPropertyBoolean("General.MPP", false);
if (mpp)
testMPP(properties);
else
test(properties);
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例9: GeneralVariableSelection
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
/**
* Constructor
*
* @param properties
* input configuration
*/
public GeneralVariableSelection(DataProperties properties) {
iUnassignWhenNotGood = properties.getPropertyBoolean("Variable.UnassignWhenNoGood", iUnassignWhenNotGood);
iUnassignWhenNotGoodRandWalk = properties.getPropertyDouble("Variable.UnassignWhenNoGoodRandomWalk",
iUnassignWhenNotGoodRandWalk);
iRandomSelection = properties.getPropertyBoolean("Variable.RandomSelection", iRandomSelection);
}
示例10: 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);
}
示例11: LastLikeStudentCourseDemands
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public LastLikeStudentCourseDemands(DataProperties properties) {
iUsePriorities = properties.getPropertyBoolean("LastLikeStudentCourseDemands.UsePriorities", iUsePriorities);
iBasePriorityWeight = properties.getPropertyDouble("LastLikeStudentCourseDemands.BasePriorityWeight", iBasePriorityWeight);
}
示例12: createConfig
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
@Override
public DataProperties createConfig(Long settingsId, Map<Long, String> options) {
DataProperties properties = new DataProperties();
// Load properties
for (SolverParameterDef def: (List<SolverParameterDef>)SolverPredefinedSettingDAO.getInstance().getSession().createQuery(
"from SolverParameterDef where group.type = :type").setInteger("type", SolverParameterGroup.SolverType.EXAM.ordinal()).list()) {
if (def.getDefault() != null) properties.put(def.getName(), def.getDefault());
if (options != null && options.containsKey(def.getUniqueId()))
properties.put(def.getName(), options.get(def.getUniqueId()));
}
SolverPredefinedSetting settings = SolverPredefinedSettingDAO.getInstance().get(settingsId);
for (SolverParameter param: settings.getParameters()) {
if (!param.getDefinition().isVisible() || param.getDefinition().getGroup().getSolverType() != SolverParameterGroup.SolverType.EXAM) continue;
properties.put(param.getDefinition().getName(),param.getValue());
if (options != null && options.containsKey(param.getDefinition().getUniqueId()))
properties.put(param.getDefinition().getName(), options.get(param.getDefinition().getUniqueId()));
}
properties.setProperty("General.SettingsId", settings.getUniqueId().toString());
// Generate extensions
String ext = properties.getProperty("Extensions.Classes", "");
if (properties.getPropertyBoolean("ExamGeneral.CBS", true)) {
if (!ext.isEmpty()) ext += ";";
ext += ConflictStatistics.class.getName();
properties.setProperty("ConflictStatistics.Print","true");
}
String mode = properties.getProperty("ExamBasic.Mode","Initial");
if ("MPP".equals(mode))
properties.setProperty("General.MPP","true");
properties.setProperty("Extensions.Classes", ext);
// Interactive mode?
if (properties.getPropertyBoolean("Basic.DisobeyHard",false))
properties.setProperty("General.InteractiveMode", "true");
// When finished?
if ("No Action".equals(properties.getProperty("ExamBasic.WhenFinished"))) {
properties.setProperty("General.Save","false");
properties.setProperty("General.CreateNewSolution","false");
properties.setProperty("General.Unload","false");
} else if ("Save".equals(properties.getProperty("ExamBasic.WhenFinished"))) {
properties.setProperty("General.Save","true");
properties.setProperty("General.CreateNewSolution","false");
properties.setProperty("General.Unload","false");
} else if ("Save and Unload".equals(properties.getProperty("ExamBasic.WhenFinished"))) {
properties.setProperty("General.Save","true");
properties.setProperty("General.CreateNewSolution","false");
properties.setProperty("General.Unload","true");
}
// XML save/load properties
properties.setProperty("Xml.ShowNames", "true");
properties.setProperty("Exam.GreatDeluge", ("Great Deluge".equals(properties.getProperty("Exam.Algorithm","Great Deluge"))?"true":"false"));
properties.setProperty("Search.GreatDeluge", ("Great Deluge".equals(properties.getProperty("Exam.Algorithm","Great Deluge"))?"true":"false"));
// Distances Matrics
if (properties.getProperty("Distances.Ellipsoid") == null || properties.getProperty("Distances.Ellipsoid").equals("DEFAULT"))
properties.setProperty("Distances.Ellipsoid", ApplicationProperties.getProperty(ApplicationProperty.DistanceEllipsoid));
if (properties.getProperty("Parallel.NrSolvers") == null) {
properties.setProperty("Parallel.NrSolvers", String.valueOf(Math.max(1, Runtime.getRuntime().availableProcessors() / 2)));
}
properties.setProperty("General.UseAmPm", CONSTANTS.useAmPm() ? "true" : "false");
properties.expand();
return properties;
}
示例13: createConfig
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
@Override
public DataProperties createConfig(Long settingsId, Map<Long, String> options) {
DataProperties properties = new DataProperties();
try {
InputStream is = getClass().getClassLoader().getResourceAsStream("org/cpsolver/instructor/default.properties");
if (is != null) properties.load(is);
} catch (IOException e) {
sLog.warn("Failed to load configuration defaults:" + e.getMessage());
}
// Load properties
for (SolverParameterDef def: (List<SolverParameterDef>)SolverPredefinedSettingDAO.getInstance().getSession().createQuery(
"from SolverParameterDef where group.type = :type").setInteger("type", SolverParameterGroup.SolverType.INSTRUCTOR.ordinal()).list()) {
if (def.getDefault() != null) properties.put(def.getName(), def.getDefault());
if (options != null && options.containsKey(def.getUniqueId()))
properties.put(def.getName(), options.get(def.getUniqueId()));
}
SolverPredefinedSetting settings = SolverPredefinedSettingDAO.getInstance().get(settingsId);
for (SolverParameter param: settings.getParameters()) {
if (!param.getDefinition().isVisible() || param.getDefinition().getGroup().getSolverType() != SolverParameterGroup.SolverType.INSTRUCTOR) continue;
properties.put(param.getDefinition().getName(),param.getValue());
if (options != null && options.containsKey(param.getDefinition().getUniqueId()))
properties.put(param.getDefinition().getName(), options.get(param.getDefinition().getUniqueId()));
}
properties.setProperty("General.SettingsId", settings.getUniqueId().toString());
// Generate extensions
String ext = properties.getProperty("Extensions.Classes", "");
if (properties.getPropertyBoolean("General.CBS", true)) {
if (!ext.isEmpty()) ext += ";";
ext += ConflictStatistics.class.getName();
properties.setProperty("ConflictStatistics.Print","true");
}
String mode = properties.getProperty("Basic.Mode","Initial");
if ("MPP".equals(mode))
properties.setProperty("General.MPP","true");
properties.setProperty("Extensions.Classes", ext);
// Interactive mode?
if (properties.getPropertyBoolean("Basic.DisobeyHard", false))
properties.setProperty("General.InteractiveMode", "true");
// When finished?
if ("No Action".equals(properties.getProperty("Basic.WhenFinished"))) {
properties.setProperty("General.Save","false");
properties.setProperty("General.CreateNewSolution","false");
properties.setProperty("General.Unload","false");
} else if ("Save".equals(properties.getProperty("Basic.WhenFinished"))) {
properties.setProperty("General.Save","true");
properties.setProperty("General.CreateNewSolution","false");
properties.setProperty("General.Unload","false");
} else if ("Save and Unload".equals(properties.getProperty("Basic.WhenFinished"))) {
properties.setProperty("General.Save","true");
properties.setProperty("General.CreateNewSolution","false");
properties.setProperty("General.Unload","true");
}
// XML save/load properties
properties.setProperty("Xml.ShowNames", "true");
properties.setProperty("Search.GreatDeluge", ("Great Deluge".equals(properties.getProperty("General.Algorithm","Great Deluge"))?"true":"false"));
// Distances Matrics
if (properties.getProperty("Distances.Ellipsoid") == null || properties.getProperty("Distances.Ellipsoid").equals("DEFAULT"))
properties.setProperty("Distances.Ellipsoid", ApplicationProperties.getProperty(ApplicationProperty.DistanceEllipsoid));
if (properties.getProperty("Parallel.NrSolvers") == null) {
properties.setProperty("Parallel.NrSolvers", "1"); // String.valueOf(Math.max(1, Runtime.getRuntime().availableProcessors() / 2))
}
properties.setProperty("General.UseAmPm", CONSTANTS.useAmPm() ? "true" : "false");
properties.expand();
return properties;
}
示例14: execute
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
@Override
public SectioningReportRpcResponse execute(SectioningReportRpcRequest request, SessionContext context) {
DataProperties parameters = new DataProperties(request.getParameters());
CSVFile csv = null;
boolean online = parameters.getPropertyBoolean("online", false);
parameters.setProperty("useAmPm", CONSTANTS.useAmPm() ? "true" : "false");
if (online) {
context.checkPermission(Right.SchedulingReports);
OnlineSectioningServer server = solverServerService.getOnlineStudentSchedulingContainer().getSolver(context.getUser().getCurrentAcademicSessionId().toString());
if (server == null)
throw new GwtRpcException("Online student scheduling is not enabled for " + context.getUser().getCurrentAuthority().getQualifiers("Session").get(0).getQualifierLabel() + ".");
OnlineSectioningLog.Entity user = OnlineSectioningLog.Entity.newBuilder()
.setExternalId(context.getUser().getExternalUserId())
.setName(context.getUser().getName() == null ? context.getUser().getUsername() : context.getUser().getName())
.setType(context.hasPermission(Right.StudentSchedulingAdvisor) ? OnlineSectioningLog.Entity.EntityType.MANAGER : OnlineSectioningLog.Entity.EntityType.STUDENT).build();
csv = server.execute(server.createAction(GenerateSectioningReport.class).withParameters(parameters), user);
} else {
context.checkPermission(Right.StudentSectioningSolver);
StudentSolverProxy solver = studentSectioningSolverService.getSolver();
if (solver == null)
throw new GwtRpcException("No student solver is running.");
csv = solver.getReport(parameters);
}
if (csv == null)
throw new GwtRpcException("No report was created.");
SectioningReportRpcResponse response = new SectioningReportRpcResponse();
String[] header = new String[csv.getHeader().getFields().size()];
for (int i = 0; i < csv.getHeader().getFields().size(); i++)
header[i] = csv.getHeader().getField(i).toString();
response.addLine(header);
if (csv.getLines() != null)
for (CSVLine line: csv.getLines()) {
String[] row = new String[line.getFields().size()];
for (int i = 0; i < line.getFields().size(); i++)
row[i] = line.getField(i).toString();
response.addLine(row);
}
return response;
}
示例15: StudentSctNeighbourSelection
import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public StudentSctNeighbourSelection(DataProperties properties) throws Exception {
super(properties);
iUseConstruction = properties.getPropertyBoolean("Sectioning.UsePriorityConstruction", iUseConstruction);
iMPP = properties.getPropertyBoolean("General.MPP", false);
iShuffleStudentsSelection = properties.getPropertyBoolean("Shuffle.Enabled", true) && properties.getPropertyBoolean("Load.RequestGroups", false);
}