extension/src/main/java/org/justinnk/masonssa/extension/Agent.java
/**
   * Add a new behaviour rule to this agent.
   *
   * @param action The action which to add.
   */
Add a new behaviour rule to this agent.
@param action The action which to add.
Add a new behaviour rule to this agent . @param action The action which to add .
protected void addAction(Action action) {
    /* actions must have names unique within agents. */
    if (this.actions.stream().anyMatch((a) -> Objects.equals(a.getName(), action.getName()))) {
      System.err.println("Error: Agent actions must have unique names.");
      System.exit(1);
    }
    /* Do not forget to claim ownership :) */
    action.setOwner(this);
    actions.add(action);
  }
protected void addAction ( Action action ) { /* actions must have names unique within agents. */ if ( this . actions . stream ( ) . anyMatch ( ( a ) -> Objects . equals ( a . getName ( ) , action . getName ( ) ) ) ) { System . err . println ( "Error: Agent actions must have unique names." ) ; System . exit ( 1 ) ; } /* Do not forget to claim ownership :) */ action . setOwner ( this ) ; actions . add ( action ) ; }
Add a new behaviour rule to this agent.
Add a new behaviour rule to this agent .