Beispiel #1
0
  public State(
      final String stateId,
      final boolean initialised,
      final boolean invariantKo,
      final boolean timeoutOccured,
      final boolean maxOperationReached,
      final Collection<Variable> stateValues,
      final List<Operation> enabledOperations,
      final Collection<StateError> stateErrors,
      final Set<String> timeoutedOperations) {
    this.id = stateId;
    this.initialized = initialised;
    this.invariantViolated = invariantKo;
    this.timeoutOccured = timeoutOccured;
    this.maxOperationReached = maxOperationReached;
    this.stateErrors = stateErrors;
    this.timeout = timeoutedOperations;

    Map<String, Variable> vars = new HashMap<String, Variable>(stateValues.size());
    for (Variable v : stateValues) {
      final String identifier = v.getIdentifier();
      if (vars.containsKey(identifier)) {
        Logger.notifyUser("ProB returned a variable twice.");
      } else {
        vars.put(identifier, v);
      }
    }
    this.stateValues = Collections.unmodifiableMap(vars);

    Logger.assertProB(ERROR_MSG, enabledOperations != null);

    this.enabledOperations = Collections.unmodifiableList(enabledOperations);
  }
Beispiel #2
0
 public final void notifyUserOnce() {
   if (!handled) {
     handled = true;
     Logger.notifyUser(this.getMessage(), this);
   }
 }