Esempio n. 1
0
  public final boolean isMutex(Operator operator) {
    // First, we verify if any of this Operator's preconditions is mutex
    // with any precondition or effect in the target Operator

    // If any mutex is found, we can return immediately
    for (Proposition proposition : preconds) {
      for (Proposition precond : operator.getPreconds()) {
        if (proposition.isMutex(precond)) {
          return true;
        }
      }

      for (Proposition effect : operator.getEffects()) {
        if (proposition.isMutex(effect)) {
          return true;
        }
      }
    }

    // Verify if any of this Operator's effetcs is mutex with any
    // precondition or effect in the target Operator
    // Again, if we bump into any mutex, we can return immediately
    for (Proposition proposition : effects) {
      for (Proposition precond : operator.getPreconds()) {
        if (proposition.isMutex(precond)) {
          return true;
        }
      }

      for (Proposition effect : operator.getEffects()) {
        if (proposition.isMutex(effect)) {
          return true;
        }
      }
    }
    return false;
  }
Esempio n. 2
0
 public OperatorImpl(Operator operator) {
   this((Structure) operator, operator.getPreconds(), operator.getEffects());
 }