本文整理汇总了Java中edacc.model.StatusCode类的典型用法代码示例。如果您正苦于以下问题:Java StatusCode类的具体用法?Java StatusCode怎么用?Java StatusCode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StatusCode类属于edacc.model包,在下文中一共展示了StatusCode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jobReset
import edacc.model.StatusCode; //导入依赖的package包/类
protected void jobReset(ExperimentResult er) {
if (er.getStatus().equals(StatusCode.RUNNING)) {
numRunningJobs--;
}
if (!er.getStatus().equals(StatusCode.NOT_STARTED) && !er.getStatus().equals(StatusCode.RUNNING)) {
numFinishedJobs--;
}
if (String.valueOf(er.getResultCode().getResultCode()).startsWith("1")) {
numSuccessfulJobs--;
}
if (!er.getStatus().equals(StatusCode.NOT_STARTED)) {
numNotStartedJobs++;
}
er.setStatus(StatusCode.NOT_STARTED);
er.setResultCode(ResultCode.UNKNOWN);
}
示例2: startJob
import edacc.model.StatusCode; //导入依赖的package包/类
public void startJob(ExperimentResultWrapper ew) {
if (currentJob != null) {
throw new IllegalArgumentException("Can't start a job, when a job is running");
}
currentJob = ew;
currentJob.status = StatusCode.RUNNING;
if (ew.creationTime > idleSince) {
idleSince = ew.creationTime;
}
currentJob.startTime = idleSince;
float cpuTime = currentJob.getCPUTimeLimit();
if (currentJob.er.getStatus().equals(StatusCode.SUCCESSFUL)) {
cpuTime = currentJob.er.getResultTime();
}
currentJobEndTime = currentJob.startTime + Math.round(cpuTime * 1000);
checkJob();
}
示例3: bSaveActionPerformed
import edacc.model.StatusCode; //导入依赖的package包/类
private void bSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bSaveActionPerformed
int statusCode = Integer.parseInt(tfId.getText());
String description = tfDescription.getText();
StatusCode code = new StatusCode(statusCode, description);
try {
StatusCodeDAO.save(code);
} catch (SQLException ex) {
JOptionPane.showMessageDialog(this,
"An error occured while saving the new status code: " + ex.getMessage(),
"Error",
JOptionPane.ERROR_MESSAGE);
} finally {
this.setVisible(false);
tfId.setText("");
tfDescription.setText("");
}
}
示例4: getResult
import edacc.model.StatusCode; //导入依赖的package包/类
/**
* Returns an ExperimentResult identified by solverConfig id, instance id and run for the current experiment.
* @param solverConfigId the solverConfig id for the ExperimentResult
* @param instanceId the instance id for the ExperimentResult
* @param run the run
* @param status the experiment results have a status specified by this array
* @return returns null if there is no such ExperimentResult
*/
public synchronized ExperimentResult getResult(int solverConfigId, int instanceId, int run, StatusCode[] status) {
ExperimentResult res = resultMap.get(new ResultIdentifier(solverConfigId, instanceId, run));
if (status != null && res != null) {
boolean found = false;
for (StatusCode s : status) {
if (res.getStatus().equals(s)) {
found = true;
break;
}
}
if (!found) {
return null;
}
}
return res;
}
示例5: menuResetJobsActionPerformed
import edacc.model.StatusCode; //导入依赖的package包/类
private void menuResetJobsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuResetJobsActionPerformed
int userinput = JOptionPane.showConfirmDialog(this, "Do you really want to reset the currently visible jobs? " + tableJobs.getRowCount() + " jobs will be resetted.", "Reset Jobs", JOptionPane.YES_NO_OPTION);
if (userinput == JOptionPane.YES_OPTION) {
Tasks.startTask(new TaskRunnable() {
@Override
public void run(Tasks task) {
try {
expController.setStatus(StatusCode.NOT_STARTED);
} catch (final SQLException ex) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
EDACCExperimentMode.this.createDatabaseErrorMessage(ex);
}
});
}
}
});
}
}
示例6: getRunningJobs
import edacc.model.StatusCode; //导入依赖的package包/类
/**
* Returns the running jobs at the last <code>updateJobs()</code> call. <br/>
* Running jobs means, <code>statusCode</code> equals
* <code>StatusCode.RUNNING</code>.
*
* @return
*/
public List<ExperimentResult> getRunningJobs() {
LinkedList<ExperimentResult> res = new LinkedList<ExperimentResult>();
for (ExperimentResult j : jobs) {
if (j.getStatus().equals(StatusCode.RUNNING)) {
res.add(j);
}
}
return res;
}
示例7: getFinishedJobs
import edacc.model.StatusCode; //导入依赖的package包/类
/**
* Returns the finished jobs at the last <code>updateJobs()</code> call. <br/>
* Finished jobs means, <code>statusCode</code> is different to
* <code>StatusCode.NOT_STARTED</code> and <code>StatusCode.RUNNING</code>.
*
* @return
*/
public List<ExperimentResult> getFinishedJobs() {
LinkedList<ExperimentResult> res = new LinkedList<ExperimentResult>();
for (ExperimentResult j : jobs) {
if (!j.getStatus().equals(StatusCode.NOT_STARTED) && !j.getStatus().equals(StatusCode.RUNNING)) {
res.add(j);
}
}
return res;
}
示例8: getNotStartedJobs
import edacc.model.StatusCode; //导入依赖的package包/类
/**
* Returns the not started jobs at the last <code>updateJobs()</code> call.<br/>
* Not started jobs means, <code>statusCode</code> is equal to
* <code>StatusCode.NOT_STARTED</code>.
*
* @return
*/
public List<ExperimentResult> getNotStartedJobs() {
LinkedList<ExperimentResult> res = new LinkedList<ExperimentResult>();
for (ExperimentResult j : jobs) {
if (j.getStatus().equals(StatusCode.NOT_STARTED)) {
res.add(j);
}
}
return res;
}
示例9: ExperimentResultWrapper
import edacc.model.StatusCode; //导入依赖的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;
}
示例10: getResultTime
import edacc.model.StatusCode; //导入依赖的package包/类
@Override
public float getResultTime() {
if (status.equals(StatusCode.NOT_STARTED) || status.equals(StatusCode.RUNNING)) {
return 0.f;
} else {
return er.getResultTime();
}
}
示例11: getResultCode
import edacc.model.StatusCode; //导入依赖的package包/类
@Override
public ResultCode getResultCode() {
if (status.equals(StatusCode.NOT_STARTED) || status.equals(StatusCode.RUNNING)) {
return ResultCode.UNKNOWN;
} else {
return er.getResultCode();
}
}
示例12: EDACCExperimentModeUpdateStatus
import edacc.model.StatusCode; //导入依赖的package包/类
/** Creates new form EDACCExperimentModeUpdateStatus */
public EDACCExperimentModeUpdateStatus(java.awt.Frame parent, boolean modal, ExperimentController expController) {
super(parent, modal);
initComponents();
this.expController = expController;
comboStatus.removeAllItems();
for (StatusCode status : StatusCode.CONST) {
comboStatus.addItem(status);
}
comboStatus.addItem("custom");
}
示例13: comboStatusActionPerformed
import edacc.model.StatusCode; //导入依赖的package包/类
private void comboStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboStatusActionPerformed
if (comboStatus.getSelectedItem() instanceof StatusCode) {
txtStatus.setText("" + ((StatusCode) comboStatus.getSelectedItem()).getStatusCode());
txtStatus.setEnabled(false);
} else {
txtStatus.setEnabled(true);
}
}
示例14: getSelectedStatusCodes
import edacc.model.StatusCode; //导入依赖的package包/类
public ArrayList<StatusCode> getSelectedStatusCodes() {
ArrayList<StatusCode> res = new ArrayList<StatusCode>();
for (int i = 0; i < getRowCount(); i++) {
if (selected[i]) {
res.add(statusCount.get(i).getStatusCode());
}
}
return res;
}
示例15: getResults
import edacc.model.StatusCode; //导入依赖的package包/类
/**
* Returns a Vector of all ExperimentResults in the current experiment with the solverConfig id and instance id specified
* @param solverConfigId the solverConfig id of the ExperimentResults
* @param instanceId the instance id of the ExperimentResults
* @param status the experiment results have a status specified by this array
* @return returns an empty vector if there are no such ExperimentResults
*/
public ArrayList<ExperimentResult> getResults(int solverConfigId, int instanceId, StatusCode[] status) {
ArrayList<ExperimentResult> res = new ArrayList<ExperimentResult>();
ExperimentResult result;
for (int i = 0; i < getNumRuns(solverConfigId, instanceId); i++) {
if ((result = getResult(solverConfigId, instanceId, i, status)) != null) {
res.add(result);
}
}
return res;
}