本文整理汇总了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);
}
示例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];
}
示例3: getImporters
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
public AbstractSolutionImporter[] getImporters() {
return importers;
}
示例4: setImporters
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
public void setImporters(AbstractSolutionImporter[] importers) {
this.importers = importers;
}
示例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);
}
示例6: createSolutionImporters
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
protected AbstractSolutionImporter[] createSolutionImporters() {
return new AbstractSolutionImporter[]{};
}
示例7: createSolutionImporters
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter[] createSolutionImporters() {
return new AbstractSolutionImporter[]{
new ReindeerRoutingImporter()
};
}
示例8: createSolutionImporter
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
return new ColoringImporter();
}
示例9: createSolutionImporter
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
return new CourseraVrpImporter();
}
示例10: createSolutionImporter
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
return new CourseraTspImporter();
}
示例11: createSolutionImporter
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
return new KnapsackImporter();
}
示例12: createSolutionImporter
import org.optaplanner.examples.common.persistence.AbstractSolutionImporter; //导入依赖的package包/类
@Override
protected AbstractSolutionImporter createSolutionImporter() {
return new FacultyPlacerImporter();
}