Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## alice.tuprolog
Class Agent

    java.lang.Object
      alice.tuprolog.Agent

public class Agent
extends java.lang.Object

Provides a prolog virtual machine embedded in a separate thread. It needs a theory and optionally a goal. It parses the theory, solves the goal and stops.

See Also:
  `Prolog`

Constructor Summary
`Agent(java.io.InputStream is)` Constructs the Agent with a theory provided by an input stream
`Agent(java.io.InputStream is, java.lang.String goal)` Constructs the Agent with a theory provided by an input stream and a goal
`Agent(java.lang.String theory)` Builds a prolog agent providing it a theory
`Agent(java.lang.String theory, java.lang.String goal)` Builds a prolog agent providing it a theory and a goal

Method Summary
`void` | `addOutputListener(OutputListener l)` Adds a listener to ouput events
`static void` | `main(java.lang.String[] args)`
`void` | `removeAllOutputListener()` Removes all output event listeners
`void` | `removeOutputListener(OutputListener l)` Removes a listener to ouput events
`void` | `spawn()` Starts agent execution

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Agent

    public Agent(java.lang.String theory)

  Builds a prolog agent providing it a theory

Parameters:
  `theory` - the text representing the theory

### Agent

    public Agent(java.lang.String theory,
                 java.lang.String goal)

  Builds a prolog agent providing it a theory and a goal

### Agent

    public Agent(java.io.InputStream is)

  Constructs the Agent with a theory provided by an input stream

### Agent

    public Agent(java.io.InputStream is,
                 java.lang.String goal)

  Constructs the Agent with a theory provided by an input stream and a goal

Method Detail

### spawn

    public final void spawn()

  Starts agent execution

### addOutputListener

    public void addOutputListener(OutputListener l)

  Adds a listener to ouput events

  Parameters:
    `l` - the listener

### removeOutputListener

    public void removeOutputListener(OutputListener l)

  Removes a listener to ouput events

  Parameters:
    `l` - the listener

### removeAllOutputListener

    public void removeAllOutputListener()

  Removes all output event listeners

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD