本文整理汇总了Java中edacc.model.ConfigurationScenarioDAO类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationScenarioDAO类的具体用法?Java ConfigurationScenarioDAO怎么用?Java ConfigurationScenarioDAO使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationScenarioDAO类属于edacc.model包,在下文中一共展示了ConfigurationScenarioDAO类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: STTRace
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
/**
* @param pacc
* @param api
* @param parameters
* @throws SQLException
*/
public STTRace(AAC pacc, Random rng, API api, Parameters parameters, List<SolverConfiguration> firstSCs, List<SolverConfiguration> referenceSCs) throws SQLException {
super(pacc, rng, api, parameters, firstSCs, referenceSCs);
this.a = 0.7;
this.minEB = 10;
incumbentNumber = 0;
num_instances = ConfigurationScenarioDAO.getConfigurationScenarioByExperimentId(parameters.getIdExperiment())
.getCourse().getInitialLength();
this.maxE = parameters.getMaxParcoursExpansionFactor() * num_instances;
this.randJob = true;
String val;
if ((val = parameters.getRacingMethodParameters().get("STTRace_a")) != null)
this.a = Double.parseDouble(val);
if ((val = parameters.getRacingMethodParameters().get("STTRace_randJob")) != null)
this.randJob = Boolean.parseBoolean(val);
if (this.minEB < 0) {
System.out.println("<STTRace_minEB> <0 not allowed! Setting <STTRace_minEB> to default!)");
this.minEB = 10;
}
nf = NumberFormat.getInstance(Locale.ENGLISH);
nf.setMinimumFractionDigits(5);
nf.setMaximumFractionDigits(15);
}
示例2: configurationScenarioIsModified
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public boolean configurationScenarioIsModified() {
if (activeExperiment == null || !activeExperiment.isConfigurationExp()) {
return false;
}
if (savedScenario == null) {
return true;
}
if (main.configScenarioTableModel.getSolverBinary() == null || savedScenario.getIdSolverBinary() != main.configScenarioTableModel.getSolverBinary().getId()) {
return true;
}
HashMap<Integer, ConfigurationScenarioParameter> configParameters = main.configScenarioTableModel.getConfigScenarioParameters();
if (configParameters == null) {
return true;
}
if (savedScenario.getParameters().size() != configParameters.size()) {
return true;
}
for (ConfigurationScenarioParameter param : configParameters.values()) {
if (!ConfigurationScenarioDAO.configurationScenarioParameterIsSaved(param)) {
return true;
}
}
return false;
}
示例3: Roar
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public Roar(AAC proar, Random rng, API api, Parameters parameters,
List<SolverConfiguration> firstSCs,
List<SolverConfiguration> referenceSCs) throws Exception {
super(proar, rng, api, parameters, firstSCs, referenceSCs);
incumbentNumber = 0;
num_instances = ConfigurationScenarioDAO
.getConfigurationScenarioByExperimentId(
parameters.getIdExperiment()).getCourse()
.getInitialLength();
HashMap<String, String> params = parameters.getRacingMethodParameters();
if (params.containsKey("Roar_useClustering")) {
clustering = Boolean.parseBoolean(params.get("Roar_useClustering"));
}
if (params.containsKey("Roar_capping")) {
aggressiveCapping = Boolean
.parseBoolean(params.get("Roar_capping"));
}
if (params.containsKey("Roar_cappingFactor")) {
maxCappingFactor = Float.parseFloat(params
.get("Roar_cappingFactor"));
}
if (clustering) {
clusterHandler = new ClusterHandler(proar, parameters, api, rng,
firstSCs, referenceSCs);
bestSC = clusterHandler.initBestSC();
} else {
initBestSC(firstSCs.get(0));
}
}
示例4: Default
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public Default(AAC proar, Random rng, API api, Parameters parameters, List<SolverConfiguration> firstSCs, List<SolverConfiguration> referenceSCs) throws Exception {
super(proar, rng, api, parameters, firstSCs, referenceSCs);
incumbentNumber = 0;
num_instances = ConfigurationScenarioDAO.getConfigurationScenarioByExperimentId(parameters.getIdExperiment()).getCourse().getInitialLength();
if (!firstSCs.isEmpty()) {
// TODO: ...
initBestSC(firstSCs.get(0));
}
}
示例5: DefaultClusteredCourse
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public DefaultClusteredCourse(AAC proar, Random rng, API api, Parameters parameters, List<SolverConfiguration> firstSCs, List<SolverConfiguration> referenceSCs) throws Exception {
super(proar, rng, api, parameters, firstSCs, referenceSCs);
incumbentNumber = 0;
num_instances = ConfigurationScenarioDAO.getConfigurationScenarioByExperimentId(parameters.getIdExperiment()).getCourse().getInitialLength();
String val;
if ((val = parameters.getRacingMethodParameters().get("DefaultClusteredCourse_featureFolder")) != null)
featureFolder = val;
if ((val = parameters.getRacingMethodParameters().get("DefaultClusteredCourse_featureCacheFolder")) != null)
featureCacheFolder = val;
rengine = RInterface.getRengine();
if (rengine.eval("library(asbio)") == null) {
rengine.end();
throw new Exception("Did not find R library asbio (try running install.packages(\"asbio\")).");
}
if (rengine.eval("library(survival)") == null) {
rengine.end();
throw new Exception("Did not find R library survival (should come with R though).");
}
this.completeCourse = new StratifiedClusterCourse(rengine, api.getExperimentInstances(parameters.getIdExperiment()), null, null, parameters.getMaxParcoursExpansionFactor(), rng, featureFolder, featureCacheFolder, null).getCourse();
if (!firstSCs.isEmpty()) {
// TODO: ...
initBestSC(firstSCs.get(0));
}
}
示例6: saveConfigurationScenario
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public void saveConfigurationScenario() throws SQLException {
SolverBinaries solverBinary = main.configScenarioTableModel.getSolverBinary();
if (configScenario == null) {
configScenario = new ConfigurationScenario();
configScenario.setIdExperiment(activeExperiment.getId());
configScenario.setNew();
}
configScenario.setIdSolverBinary(solverBinary.getId());
configScenario.getParameters().clear();
configScenario.getParameters().addAll(main.configScenarioTableModel.getConfigScenarioParameters().values());
ConfigurationScenarioDAO.save(configScenario);
// we need a new instance for this
savedScenario = ConfigurationScenarioDAO.getConfigurationScenarioByExperimentId(activeExperiment.getId());
}
示例7: FullEvaluation
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public FullEvaluation(AAC pacc, Random rng, API api, Parameters parameters, List<SolverConfiguration> firstSCs, List<SolverConfiguration> referenceSCs) throws Exception {
super(pacc, rng, api, parameters, firstSCs, referenceSCs);
num_instances = ConfigurationScenarioDAO.getConfigurationScenarioByExperimentId(parameters.getIdExperiment()).getCourse().getInitialLength();
}
示例8: ClusterHandler
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public ClusterHandler(AAC aac, Parameters params, API api, Random rng,
List<SolverConfiguration> firstSCs, List<SolverConfiguration> referenceSCs) throws Exception{
this.rng = rng;
this.aac = aac;
this.api = api;
this.expID = params.getIdExperiment();
this.params = params;
this.firstSCs = firstSCs;
this.referenceSCs = referenceSCs;
paramGraph = api.loadParameterGraphFromDB(params.getIdExperiment());
num_instances = ConfigurationScenarioDAO
.getConfigurationScenarioByExperimentId(
params.getIdExperiment()).getCourse()
.getInitialLength();
HashMap<String, String> parameters = params.getRacingMethodParameters();
if(parameters.containsKey("Roar_ClusterAlgorithm")) {
algorithmName = parameters.get("Roar_ClusterAlgorithm");
}
if(parameters.containsKey("Roar_ClusterResources")) {
resourcesName = parameters.get("Roar_ClusterResources");
}
if (parameters.containsKey("Roar_minStartupSCs")) {
numberOfMinStartupSCs = Integer.parseInt(parameters
.get("Roar_minStartupSCs"));
}
// Initialise Algorithms and Resources here
algorithmClass = ClassLoader.getSystemClassLoader().loadClass(
"edacc.configurator.aac.clustering." + algorithmName);
resourcesClass = ClassLoader.getSystemClassLoader().loadClass(
"edacc.configurator.aac.clustering." + resourcesName);
resources = (ClusteringResources) resourcesClass
.getDeclaredConstructors()[0].newInstance(api, params, this);
algorithm = (ClusteringAlgorithm) algorithmClass
.getDeclaredConstructors()[0].newInstance(aac, resources, this);
// End algorithm+resources initialisation
//initialise data
instanceClusterMap = new HashMap<InstanceIdSeed, Integer>();
data = new HashMap<InstanceIdSeed, InstanceData>();
Course course = api.getCourse(params.getIdExperiment());
for(InstanceSeed is : course.getInstanceSeedList()){
data.put(new InstanceIdSeed(is.instance.getId(), is.seed),
new InstanceData(is.instance.getId(), is.seed, params.getStatistics().getCostFunction()));
}
if(ClusteringResources.isInitialDataRequired(resourcesName)) {
List<SolverConfiguration> startupSCs = initClusteringData();
for (SolverConfiguration sc : startupSCs) {
addData(sc);
}
} else {
numberOfMinStartupSCs = 1;
initClusteringData();
}
calculateClustering();
cpuTimeElapsed = getCPUTime();
visualiseClustering();
}
示例9: getConfigurationScenarioForExperiment
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public ConfigurationScenario getConfigurationScenarioForExperiment(Experiment exp) throws SQLException {
ConfigurationScenario scenario = ConfigurationScenarioDAO.getConfigurationScenarioByExperimentId(exp.getId());
return scenario;
}
示例10: refreshConfiguratorOutput
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public void refreshConfiguratorOutput() throws SQLException {
if (configScenario != null) {
ConfigurationScenarioDAO.updateConfiguratorOutput(configScenario);
}
}
示例11: reloadConfigurationScenario
import edacc.model.ConfigurationScenarioDAO; //导入依赖的package包/类
public void reloadConfigurationScenario() throws SQLException {
configScenario = ConfigurationScenarioDAO.getConfigurationScenarioByExperimentId(activeExperiment.getId());
}