Package aima.core.agent

Examples of aima.core.agent.Action


  //
  // PRIVATE METHODS
  //
  private boolean isTerminal(S s) {
    boolean terminal = false;
    Action a = pi.get(s);
    if (null == a || a.isNoOp()) {
      // No actions possible in state is considered terminal.
      terminal = true;
    }
    return terminal;
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  @Override
  public Action execute(Percept p) {
    if (p instanceof PerceptStateReward<?>) {
      Action a = execute((PerceptStateReward<S>) p);
      if (null == a) {
        a = NoOpAction.NO_OP;
        setAlive(false);
      }
      return a;
View Full Code Here

   * and {@link #createExogenousChange()}.
   */
  public void step() {
    for (Agent agent : agents) {
      if (agent.isAlive()) {
        Action anAction = agent.execute(getPerceptSeenBy(agent));
        EnvironmentState es = executeAction(agent, anAction);
        updateEnvironmentViewsAgentActed(agent, anAction, es);
      }
    }
    createExogenousChange();
View Full Code Here

  //
  // PRIVATE METHODS
  //
  private Action lookupCurrentAction() {
    Action action = null;

    action = table.get(percepts, ACTION);
    if (null == action) {
      action = NoOpAction.NO_OP;
    }
View Full Code Here

      }
      g2.setColor(Color.black);
      g2.drawRect(x(11 * i), y(0), scale(10), scale(10));
      g2.drawString(location.toString(), x(11 * i) + 10, y(0) + 20);
      if (agent != null) {
        Action action = lastActions.get(agent);
        g2.setColor(Color.RED);
        if (action == null || !((DynamicAction) action).getAttribute("name").equals("Suck"))
          g2.fillArc(x(11 * i + 2), y(2), scale(6), scale(6),
              200, 320);
        else
View Full Code Here

  }

  // function SIMPLE-PROBLEM-SOLVING-AGENT(percept) returns an action
  @Override
  public Action execute(Percept p) {
    Action action = NoOpAction.NO_OP;

    // state <- UPDATE-STATE(state, percept)
    updateState(p);
    // if seq is empty then do
    if (0 == seq.size()) {
View Full Code Here

TOP

Related Classes of aima.core.agent.Action

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.