Interface Environment

All Known Implementing Classes:
CompositeEnvironment, InMemoryEnvironment

public interface Environment
Abstraction for the agent's external environment.

BDI agents interact with their environment through perception and action. This interface formalizes the perception → belief update cycle.

Usage


 Environment env = new ConversationEnvironment(session);
 Percept percept = env.perceive();
 // Process percept -> update beliefs

 ActionOutcome outcome = env.act("respond", Map.of("message", "Hello"));
 
  • Method Details

    • perceive

      Percept perceive()
      Agent perceives the current state of the environment.
      Returns:
      the current percept from the environment
    • act

      ActionOutcome act(String actionName, Map<String,Object> parameters)
      Agent acts on the environment.
      Parameters:
      actionName - the action to perform
      parameters - action parameters
      Returns:
      the outcome of the action
    • onChange

      void onChange(Consumer<Percept> listener)
      Registers a listener for environment changes.
      Parameters:
      listener - called when the environment changes
    • getName

      String getName()
      Gets the environment name/type.