Example #1
0
  public OAAClient(String agentName, String[] libcomargs) throws IOException {
    outOaa = new LibOaa(new LibCom(new LibComTcpProtocol(), libcomargs));

    if (!outOaa.oaaSetupCommunication(agentName))
      throw new IOException("Could not connect to facilitator");

    if (!outOaa.oaaRegister("parent", agentName, new IclList(), new IclList()))
      throw new IOException("Could not register");

    outOaa.oaaReady(true);
  }
Example #2
0
  /**
   * Send a task to the agent community.
   *
   * @param goal The task
   * @param params Parameters
   * @return A possibly empty list of solutions.
   */
  public List<IclTerm> solve(IclTerm goal, List<IclTerm> params) {
    IclList answers = new IclList();

    if (!outOaa.oaaSolve(goal, IclUtil.fromList(params), answers))
      return Collections.<IclTerm>emptyList();

    return IclUtil.toList(answers);
  }