本文整理汇总了Java中edacc.model.ExperimentResult.getExperimentId方法的典型用法代码示例。如果您正苦于以下问题:Java ExperimentResult.getExperimentId方法的具体用法?Java ExperimentResult.getExperimentId怎么用?Java ExperimentResult.getExperimentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edacc.model.ExperimentResult
的用法示例。
在下文中一共展示了ExperimentResult.getExperimentId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAvgTime
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
public static Float getAvgTime(ArrayList<ExperimentResult> er, Integer expId) {
float res = 0.f;
int count = 0;
for (ExperimentResult e : er) {
if (expId != null && e.getExperimentId() != expId) {
continue;
}
if (e.getResultCode().isCorrect()) {
res += e.getResultTime();
count++;
}
}
if (count == 0) {
return null;
} else {
return (res / (float) count);
}
}
示例2: getMedianTime
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
public static Float getMedianTime(ArrayList<ExperimentResult> er, Integer expId) {
List<Float> resultTimes = new ArrayList<Float>();
for (ExperimentResult e : er) {
if (expId != null && e.getExperimentId() != expId) {
continue;
}
if (e.getResultCode().isCorrect()) {
resultTimes.add(e.getResultTime());
} else {
if (e.getCPUTimeLimit() > 0) {
resultTimes.add(Float.valueOf(e.getCPUTimeLimit()));
}
}
}
if (resultTimes.isEmpty()) {
return null;
} else {
return resultTimes.get(resultTimes.size() / 2);
}
}
示例3: getStatus
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
public static String getStatus(ArrayList<ExperimentResult> er, Integer expId) {
int status = UNKNOWN;
for (ExperimentResult e : er) {
if (expId != null && e.getExperimentId() != expId) {
continue;
}
if (e.getResultCode().getResultCode() == SAT) {
status = SAT;
break;
} else if (e.getResultCode().getResultCode() == UNSAT) {
if (status == UNKNOWN) {
status = UNSAT;
}
}
}
if (status == UNKNOWN) {
return "UNKNOWN";
} else if (status == SAT) {
return "SAT";
} else if (status == UNSAT) {
return "UNSAT";
}
return "";
}
示例4: calculateProperty
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
@Override
public String calculateProperty(int instanceId) throws Exception {
float minTime = Float.MAX_VALUE;
int scid = -1;
for (ExperimentResult er : ExperimentResultDAO.getAllByInstanceId(instanceId)) {
if (expId != null && er.getExperimentId() != expId) {
continue;
}
if (er.getResultCode().isCorrect()) {
if (er.getResultTime() < minTime) {
minTime = er.getResultTime();
scid = er.getSolverConfigId();
}
}
}
if (scid == -1) {
return "";
} else {
SolverConfiguration sc = SolverConfigurationDAO.getSolverConfigurationById(scid);
return sc.getName() + " (" + sc.getId() + ")";
}
}
示例5: ExperimentResultWrapper
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
public ExperimentResultWrapper(ExperimentResult er, int priority) {
// we have to fill run, solverconfig id, experiment id, instance id fields for equals method!
super(er.getRun(), 0, 0, null, 0, null, 0.f, 0.f, 0.f, er.getSolverConfigId(), er.getExperimentId(), er.getInstanceId(), null, 0, 0, 0, 0);
this.er = er;
this.status = StatusCode.NOT_STARTED;
this.priority = priority;
this.creationTime = currentTime; // System.currentTimeMillis();
this.startTime = 0;
}
示例6: getMinTime
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
public static Float getMinTime(ArrayList<ExperimentResult> er, Integer expId) {
Float res = null;
for (ExperimentResult e : er) {
if (expId != null && e.getExperimentId() != expId) {
continue;
}
if (e.getResultCode().isCorrect()) {
if (res == null || res > e.getResultTime()) {
res = e.getResultTime();
}
}
}
return res;
}
示例7: getSolvedCount
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
public static int getSolvedCount(ArrayList<ExperimentResult> er, Integer expId) {
int res = 0;
for (ExperimentResult e : er) {
if (expId != null && e.getExperimentId() != expId) {
continue;
}
if (e.getResultCode().isCorrect()) {
res++;
}
}
return res;
}
示例8: getUsedCount
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
public static int getUsedCount(ArrayList<ExperimentResult> er, Integer expId) {
int res = 0;
for (ExperimentResult e : er) {
if (expId != null && e.getExperimentId() != expId) {
continue;
}
res++;
}
return res;
}
示例9: calculateProperty
import edacc.model.ExperimentResult; //导入方法依赖的package包/类
@Override
public String calculateProperty(int id) throws Exception {
List<ExperimentResult> results = ExperimentResultDAO.getAllByInstanceId(id);
HashSet<HashMap<Integer, Integer>> solutions = new HashSet<HashMap<Integer, Integer>>();
for (ExperimentResult result : results) {
if (expId != null && result.getExperimentId() != expId) {
continue;
}
// SAT answer
if (result.getResultCode().getResultCode() == 11) {
Blob b = ExperimentResultDAO.getSolverOutput(result);
if (b == null) {
continue;
}
BufferedReader br = new BufferedReader(new InputStreamReader(b.getBinaryStream()));
String line;
HashMap<Integer, Integer> solution = new HashMap<Integer, Integer>();
while ((line = br.readLine()) != null) {
// timestamp
String tmpar[] = line.split("\t");
if (tmpar.length < 2) {
continue;
}
line = tmpar[1];
// parse solution
if (line.startsWith("v ")) {
String values[] = line.split(" ");
for (int i = 1; i < values.length; i++) {
int val = Integer.parseInt(values[i]);
solution.put(Math.abs(val), val);
}
}
}
System.out.println("SOLUTION SIZE: " + solution.size());
solutions.add(solution);
}
}
return String.valueOf(solutions.size());
}