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


Java AbstractSolutionImporter类代码示例

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


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

示例1: ImportAction

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
public ImportAction() {
    super(NAME, new ImageIcon(SolverAndPersistenceFrame.class.getResource("importAction.png")));
    if (!solutionBusiness.hasImporter()) {
        fileChooser = null;
        return;
    }
    fileChooser = new JFileChooser(solutionBusiness.getImportDataDir());
    boolean firstFilter = true;
    for (final AbstractSolutionImporter importer : solutionBusiness.getImporters()) {
        FileFilter filter;
        if (importer.isInputFileDirectory()) {
            filter = new FileFilter() {
                public boolean accept(File file) {
                    return file.isDirectory();
                }

                public String getDescription() {
                    return "Import directory";
                }
            };
            fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        } else {
            filter = new FileFilter() {
                public boolean accept(File file) {
                    return file.isDirectory() || importer.acceptInputFile(file);
                }

                public String getDescription() {
                    return "Import files (*." + importer.getInputFileSuffix() + ")";
                }
            };
        }
        fileChooser.addChoosableFileFilter(filter);
        if (firstFilter) {
            fileChooser.setFileFilter(filter);
            firstFilter = false;
        }
    }
    fileChooser.setDialogTitle(NAME);
}
 
开发者ID:xmlking,项目名称:ml-experiments,代码行数:41,代码来源:SolverAndPersistenceFrame.java

示例2: determineImporter

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
private AbstractSolutionImporter determineImporter(File file) {
    for (AbstractSolutionImporter importer : importers) {
        if (importer.acceptInputFile(file)) {
            return importer;
        }
    }
    return importers[0];
}
 
开发者ID:xmlking,项目名称:ml-experiments,代码行数:9,代码来源:SolutionBusiness.java

示例3: getImporters

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
public AbstractSolutionImporter[] getImporters() {
    return importers;
}
 
开发者ID:xmlking,项目名称:ml-experiments,代码行数:4,代码来源:SolutionBusiness.java

示例4: setImporters

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
public void setImporters(AbstractSolutionImporter[] importers) {
    this.importers = importers;
}
 
开发者ID:xmlking,项目名称:ml-experiments,代码行数:4,代码来源:SolutionBusiness.java

示例5: importSolution

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
public void importSolution(File file) {
    AbstractSolutionImporter importer = determineImporter(file);
    Solution solution = importer.readSolution(file);
    solutionFileName = file.getName();
    guiScoreDirector.setWorkingSolution(solution);
}
 
开发者ID:xmlking,项目名称:ml-experiments,代码行数:7,代码来源:SolutionBusiness.java

示例6: createSolutionImporters

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
protected AbstractSolutionImporter[] createSolutionImporters() {
    return new AbstractSolutionImporter[]{};
}
 
开发者ID:xmlking,项目名称:ml-experiments,代码行数:4,代码来源:CommonApp.java

示例7: createSolutionImporters

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter[] createSolutionImporters() {
    return new AbstractSolutionImporter[]{
            new ReindeerRoutingImporter()
    };
}
 
开发者ID:ge0ffrey,项目名称:santas-stolen-sleigh,代码行数:7,代码来源:ReindeerRoutingApp.java

示例8: createSolutionImporter

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
    return new ColoringImporter();
}
 
开发者ID:ge0ffrey,项目名称:coursera-discrete-optimization,代码行数:5,代码来源:ColoringApp.java

示例9: createSolutionImporter

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
    return new CourseraVrpImporter();
}
 
开发者ID:ge0ffrey,项目名称:coursera-discrete-optimization,代码行数:5,代码来源:CourseraVrpApp.java

示例10: createSolutionImporter

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
    return new CourseraTspImporter();
}
 
开发者ID:ge0ffrey,项目名称:coursera-discrete-optimization,代码行数:5,代码来源:CourseraTspApp.java

示例11: createSolutionImporter

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
    return new KnapsackImporter();
}
 
开发者ID:ge0ffrey,项目名称:coursera-discrete-optimization,代码行数:5,代码来源:KnapsackApp.java

示例12: createSolutionImporter

import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
    return new FacultyPlacerImporter();
}
 
开发者ID:ge0ffrey,项目名称:coursera-discrete-optimization,代码行数:5,代码来源:FacultyPlacerApp.java


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