當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。