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


Java DataProperties.putAll方法代码示例

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


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

示例1: main

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    ToolBox.configureLogging();
    DataProperties properties = ToolBox.loadProperties(new java.io.File(args[0]));
    properties.putAll(System.getProperties());
    
    TimetableModel model = new TimetableModel(properties);
    Assignment<Lecture, Placement> assignment = new DefaultSingleAssignment<Lecture, Placement>();
    TimetableXMLLoader loader = new TimetableXMLLoader(model, assignment);
    loader.setInputFile(new File(args[1]));
    loader.load();
    
    Solution<Lecture, Placement> solution = new Solution<Lecture, Placement>(model, assignment);
    Test.saveOutputCSV(solution, new File(args[2]));
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:15,代码来源:SolutionEvaluator.java

示例2: main

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    ToolBox.configureLogging();

    DataProperties config = new DataProperties();
    if (System.getProperty("config") == null) {
        config.load(Test.class.getClass().getResourceAsStream("/org/cpsolver/instructor/default.properties"));
    } else {
        config.load(new FileInputStream(System.getProperty("config")));
    }
    config.putAll(System.getProperties());
    
    new Test(config).execute();
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:14,代码来源:Test.java

示例3: main

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    DataProperties config = new DataProperties();
    config.load(MathTest.class.getClass().getResourceAsStream("/org/cpsolver/instructor/test/math.properties"));
    config.putAll(System.getProperties());
    ToolBox.configureLogging();
    
    new MathTest(config).execute();
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:9,代码来源:MathTest.java

示例4: main

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    DataProperties config = new DataProperties();
    config.load(ChmTest.class.getClass().getResourceAsStream("/org/cpsolver/instructor/test/chm.properties"));
    config.putAll(System.getProperties());
    ToolBox.configureLogging();
    
    new ChmTest(config).execute();
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:9,代码来源:ChmTest.java

示例5: main

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public static void main(String[] args) {
    try {
        DataProperties cfg = new DataProperties();
        cfg.setProperty("Termination.Class","org.cpsolver.ifs.termination.GeneralTerminationCondition");
        cfg.setProperty("Termination.StopWhenComplete","true");
        cfg.setProperty("Termination.TimeOut","600");
        cfg.setProperty("Comparator.Class","org.cpsolver.ifs.solution.GeneralSolutionComparator");
        cfg.setProperty("Value.Class","org.cpsolver.ifs.heuristics.GeneralValueSelection");
        cfg.setProperty("Value.WeightConflicts", "1.0");
        cfg.setProperty("Value.WeightNrAssignments", "0.0");
        cfg.setProperty("Variable.Class","org.cpsolver.ifs.heuristics.GeneralVariableSelection");
        cfg.setProperty("Neighbour.Class","org.cpsolver.studentsct.heuristics.StudentSctNeighbourSelection");
        cfg.setProperty("General.SaveBestUnassigned", "-1");
        cfg.setProperty("Extensions.Classes","org.cpsolver.ifs.extension.ConflictStatistics;org.cpsolver.studentsct.extension.DistanceConflict");
        cfg.setProperty("Data.Initiative","woebegon");
        cfg.setProperty("Data.Term","Fal");
        cfg.setProperty("Data.Year","2007");
        cfg.setProperty("Load.IncludeCourseDemands", (sIncludeCourseDemands?"true":"false"));
        cfg.setProperty("Load.IncludeLastLikeStudents", (sIncludeLastLikeStudents?"true":"false"));
        cfg.setProperty("Load.IncludeUseCommittedAssignments", (sIncludeUseCommittedAssignments?"true":"false"));
        //cfg.setProperty("Load.MakeupAssignmentsFromRequiredPrefs", "true");
        if (args.length>=1) {
            cfg.load(new FileInputStream(args[0]));
        }
        cfg.putAll(System.getProperties());
        
        if (args.length>=2) {
            File logFile = new File(ToolBox.configureLogging(args[1], cfg, true, false));
            cfg.setProperty("General.Output", logFile.getParentFile().getAbsolutePath());
        } else {
            ToolBox.configureLogging();
            cfg.setProperty("General.Output", System.getProperty("user.home", ".")+File.separator+"Sectioning-Test");
        }
        Logger.getLogger(BacktrackNeighbourSelection.class).setLevel(cfg.getPropertyBoolean("Debug.BacktrackNeighbourSelection",false)?Level.DEBUG:Level.INFO);
        
        HibernateUtil.configureHibernate(cfg);
        
        batchSectioning(cfg);
    } catch (Exception e) {
        sLog.error(e.getMessage(),e);
        e.printStackTrace();
    }
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:44,代码来源:BatchStudentSectioningTest.java

示例6: main

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
public static void main(String[] args) {
    try {
        System.setProperty("jprof", "cpu");
        BasicConfigurator.configure();

        DataProperties cfg = new DataProperties();
        cfg.setProperty("Neighbour.BranchAndBoundTimeout", "5000");
        cfg.setProperty("Suggestions.Timeout", "1000");
        cfg.setProperty("Extensions.Classes", DistanceConflict.class.getName() + ";" + TimeOverlapsCounter.class.getName());
        cfg.setProperty("StudentWeights.Class", StudentSchedulingAssistantWeights.class.getName());
        cfg.setProperty("StudentWeights.PriorityWeighting", "true");
        cfg.setProperty("StudentWeights.LeftoverSpread", "true");
        cfg.setProperty("StudentWeights.BalancingFactor", "0.0");
        cfg.setProperty("Reservation.CanAssignOverTheLimit", "true");
        cfg.setProperty("Distances.Ellipsoid", DistanceMetric.Ellipsoid.WGS84.name());
        cfg.setProperty("StudentWeights.MultiCriteria", "true");
        cfg.setProperty("CourseRequest.SameTimePrecise", "true");

        cfg.setProperty("log4j.rootLogger", "INFO, A1");
        cfg.setProperty("log4j.appender.A1", "org.apache.log4j.ConsoleAppender");
        cfg.setProperty("log4j.appender.A1.layout", "org.apache.log4j.PatternLayout");
        cfg.setProperty("log4j.appender.A1.layout.ConversionPattern", "%-5p %c{2}: %m%n");
        cfg.setProperty("log4j.logger.org.hibernate", "INFO");
        cfg.setProperty("log4j.logger.org.hibernate.cfg", "WARN");
        cfg.setProperty("log4j.logger.org.hibernate.cache.EhCacheProvider", "ERROR");
        cfg.setProperty("log4j.logger.org.unitime.commons.hibernate", "INFO");
        cfg.setProperty("log4j.logger.net", "INFO");

        cfg.setProperty("Xml.LoadBest", "false");
        cfg.setProperty("Xml.LoadCurrent", "false");

        cfg.putAll(System.getProperties());

        PropertyConfigurator.configure(cfg);

        final Test test = new Test(cfg);

        final File input = new File(args[0]);
        StudentSectioningXMLLoader loader = new StudentSectioningXMLLoader(test.model(), test.assignment());
        loader.setInputFile(input);
        loader.load();

        test.run();

        Solver<Request, Enrollment> s = new Solver<Request, Enrollment>(cfg);
        s.setInitalSolution(test.model());
        StudentSectioningXMLSaver saver = new StudentSectioningXMLSaver(s);
        File output = new File(input.getParentFile(), input.getName().substring(0, input.getName().lastIndexOf('.')) +
                "-" + cfg.getProperty("run", "r0") + ".xml");
        saver.save(output);

        test.stats(input);
    } catch (Exception e) {
        sLog.error("Test failed: " + e.getMessage(), e);
    }
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:57,代码来源:Test.java

示例7: main

import org.cpsolver.ifs.util.DataProperties; //导入方法依赖的package包/类
/** Main 
 * @param args program arguments
 **/
public static void main(String[] args) {
    try {
        DataProperties cfg = new DataProperties();
        cfg.setProperty("Termination.Class", "org.cpsolver.ifs.termination.GeneralTerminationCondition");
        cfg.setProperty("Termination.StopWhenComplete", "true");
        cfg.setProperty("Termination.TimeOut", "600");
        cfg.setProperty("Comparator.Class", "org.cpsolver.ifs.solution.GeneralSolutionComparator");
        cfg.setProperty("Value.Class", "org.cpsolver.studentsct.heuristics.EnrollmentSelection");// org.cpsolver.ifs.heuristics.GeneralValueSelection
        cfg.setProperty("Value.WeightConflicts", "1.0");
        cfg.setProperty("Value.WeightNrAssignments", "0.0");
        cfg.setProperty("Variable.Class", "org.cpsolver.ifs.heuristics.GeneralVariableSelection");
        cfg.setProperty("Neighbour.Class", "org.cpsolver.studentsct.heuristics.StudentSctNeighbourSelection");
        cfg.setProperty("General.SaveBestUnassigned", "0");
        cfg.setProperty("Extensions.Classes",
                "org.cpsolver.ifs.extension.ConflictStatistics;org.cpsolver.studentsct.extension.DistanceConflict" +
                ";org.cpsolver.studentsct.extension.TimeOverlapsCounter");
        cfg.setProperty("Data.Initiative", "puWestLafayetteTrdtn");
        cfg.setProperty("Data.Term", "Fal");
        cfg.setProperty("Data.Year", "2007");
        cfg.setProperty("General.Input", "pu-sectll-fal07-s.xml");
        if (args.length >= 1) {
            cfg.load(new FileInputStream(args[0]));
        }
        cfg.putAll(System.getProperties());

        if (args.length >= 2) {
            cfg.setProperty("General.Input", args[1]);
        }

        File outDir = null;
        if (args.length >= 3) {
            outDir = new File(args[2], sDateFormat.format(new Date()));
        } else if (cfg.getProperty("General.Output") != null) {
            outDir = new File(cfg.getProperty("General.Output", "."), sDateFormat.format(new Date()));
        } else {
            outDir = new File(System.getProperty("user.home", ".") + File.separator + "Sectioning-Test" + File.separator + (sDateFormat.format(new Date())));
        }
        outDir.mkdirs();
        setupLogging(new File(outDir, "debug.log"));
        cfg.setProperty("General.Output", outDir.getAbsolutePath());

        if (args.length >= 4 && "online".equals(args[3])) {
            onlineSectioning(cfg);
        } else if (args.length >= 4 && "simple".equals(args[3])) {
            cfg.setProperty("Sectioning.UseOnlinePenalties", "false");
            onlineSectioning(cfg);
        } else {
            batchSectioning(cfg);
        }
    } catch (Exception e) {
        sLog.error(e.getMessage(), e);
        e.printStackTrace();
    }
}
 
开发者ID:UniTime,项目名称:cpsolver,代码行数:58,代码来源:Test.java


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