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

## edu.wpi.cetask.guide
Class Guide

    java.lang.Object
      edu.wpi.cetask.guide.Guide

Direct Known Subclasses:
  SpeechGuide

    public class Guide

extends Object

Nested Class Summary
`protected static class` | `Guide.Quit`

Field Summary
`protected Plan` | `accepted`
`protected String` | `command`
`protected TaskEngine` | `engine`
`protected static String` | `FOCUS_NOTE`
`protected Plan` | `proposed`
`protected Plan` | `rejected`
`static String` | `VERSION`

Constructor Summary
`protected` | `Guide(TaskEngine engine, String from)`

Method Summary
`void` | `by(String args)` Select decomposition class for current focus task.
`void` | `clear(String ignore)` Reinitialize current task state (but keeps loaded models).
`void` | `deallocate()`
`void` | `debug(String state)` Control debugging output.
`void` | `done(String args)` Report user performance of primitive task.
`protected void` | `done(Task occurrence)`
`void` | `eval(String script)` Evaluate given JavaScript code and report return value.
`protected static void` | `exception(Throwable e)`
`void` | `execute(String args)` Like 'done', but first executes script associated with primitive task, if any.
`TaskEngine` | `getEngine()`
`protected void` | `help()`
`void` | `help(String ignore)`
`boolean` | `isAuthorized()` Check whether this guide is authorized to perform system tasks without asking for permission.
`void` | `load(String from)` Load, parse and validate specified task model (XML).
`void` | `loop()` Command loop.
`static void` | `main(String[] args)`
`static Guide` | `make(String[] args)`
`void` | `next(String ignore)` Advise the user what needs to be done next.
`void` | `no(String ignore)` Reject system proposals.
`protected void` | `print(Object object)`
`protected void` | `println(Object object)`
`protected void` | `printVersion()`
`protected void` | `processCommand(String line)`
`Task` | `processTask(String args, Plan plan, boolean success)`
`protected void` | `propose(Plan plan)`
`protected void` | `respond(String key)`
`void` | `setAuthorized(boolean authorized)` Authorize this guide to perform system tasks without asking for permission.
`void` | `setOnProcessCommand(Runnable onProcessCommand)`
`void` | `source(String from)` Start reading user input from url, system resource or file identified by given string.
`protected void` | `status()`
`void` | `status(String ignore)` Print out current task decomposition tree with status information.
`protected void` | `system()` Method for system turn.
`void` | `task(String args)` Set current task focus.
`void` | `verbose(String state)` Control verbose output.
`protected static void` | `warning(String text)`
`void` | `yes(String ignore)` Accept system proposals.

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

Field Detail

### VERSION

    public static String VERSION

### engine

    protected final TaskEngine engine

### proposed

    protected Plan proposed

### accepted

    protected Plan accepted

### rejected

    protected Plan rejected

### command

    protected String command

### FOCUS_NOTE

    protected static final String FOCUS_NOTE

See Also:
  Constant Field Values

Constructor Detail

### Guide

    protected Guide(TaskEngine engine,
                    String from)

Parameters:
  `from` - if non-null, change default name of log file to correspond to name of given source and immediately start reading from that source
See Also:
  `source(String)`

Method Detail

### main

    public static void main(String[] args)

### make

    public static Guide make(String[] args)

### getEngine

    public TaskEngine getEngine()

### printVersion

    protected void printVersion()

### loop

    public void loop()

  Command loop. Uses reflection to invoke commands; see methods with command names.

### deallocate

    public void deallocate()

### setOnProcessCommand

    public void setOnProcessCommand(Runnable onProcessCommand)

  Parameters:
    `onProcessCommand` - hook to run after each user command is executed. Useful, for example, for updating associated gui

### processCommand

    protected void processCommand(String line)
                           throws Throwable

  Throws:
    `Throwable`

### respond

    protected void respond(String key)

### println

    protected void println(Object object)

### print

    protected void print(Object object)

### warning

    protected static void warning(String text)

### exception

    protected static void exception(Throwable e)

### isAuthorized

    public boolean isAuthorized()

  Check whether this guide is authorized to perform system tasks without asking for permission. Default false;

### setAuthorized

    public void setAuthorized(boolean authorized)

  Authorize this guide to perform system tasks without asking for permission.

### system

    protected void system()

  Method for system turn. Called once each time around command loop. Intended extension point.

### propose

    protected void propose(Plan plan)

### help

    public void help(String ignore)

### help

    protected void help()

### load

    public void load(String from)

  Load, parse and validate specified task model (XML).

  Parameters:
    `from` - string identifying url, system resource or file

### task

    public void task(String args)

  Set current task focus. Namespace may be omitted if it is unambiguous in currently loaded task models. JavaScript to compute all declared input and output slot values is optional (in order declared). Skipped slots can be specified by '/ /'.
  Hint: If Javascript contains '/', use 'eval' command to set temporary variable and use variable in 'done'.

  Parameters:
    `args` - <id> [<namespace>] [ / <value> ]*

### by

    public void by(String args)

  Select decomposition class for current focus task.

  Parameters:
    `args` - <id>

### done

    public void done(String args)

  Report user performance of primitive task. Task class defaults to suggested next task. JavaScript to compute all declared input and output slot values is required (in order declared). Success slot value is optional (and last). Skipped slots can be specified by '/ /'.
  Hint: If Javascript contains '/', use 'eval' command to set temporary variable and use variable in 'done'.

  Parameters:
    `args` - [<id> [<namespace>]] [ / <value> ]*

### done

    protected void done(Task occurrence)

### execute

    public void execute(String args)

  Like 'done', but first executes script associated with primitive task, if any. Convenient for running simulations.

  See Also:
    `done(String)`

### processTask

    public Task processTask(String args,
                            Plan plan,
                            boolean success)

### next

    public void next(String ignore)

  Advise the user what needs to be done next.

### yes

    public void yes(String ignore)

  Accept system proposals.

### no

    public void no(String ignore)

  Reject system proposals.

### eval

    public void eval(String script)

  Evaluate given JavaScript code and report return value.

### source

    public void source(String from)

  Start reading user input from url, system resource or file identified by given string.

### status

    public void status(String ignore)

  Print out current task decomposition tree with status information.

### status

    protected void status()

### clear

    public void clear(String ignore)

  Reinitialize current task state (but keeps loaded models).

### verbose

    public void verbose(String state)

  Control verbose output.

  Parameters:
    `state` - - "true" or "false"

### debug

    public void debug(String state)

  Control debugging output.

  Parameters:
    `state` - - "true" or "false"

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