コード例 #1
0
 private Object calculateSLAParameter() {
   float res = -1;
   try {
     factory.disableAll();
     factory.getImp("Calculate" + parameterName).enable();
     MonitoringMain.display("[SLAont] applying rule Calculate" + parameterName + "...");
     bridge.infer();
     Result result = bridge.getQueryResult("Calculate" + parameterName);
     return result.getDatatypeValue("?x").toString();
   } catch (Throwable e) {
     e.printStackTrace();
     return -1;
   }
 }
コード例 #2
0
  public void run() {
    try {
      while (true) {

        Thread.sleep(frequency);
        synchronized (factory) {
          synchronized (owlModel) {
            MonitoringMain.display("\t" + calculateSLAParameter());
          }
        }
      }
    } catch (Exception x) {
      x.printStackTrace();
    }
  }