robocup.lab
Class Brain

java.lang.Object
  extended by robocup.lab.Brain

public class Brain
extends java.lang.Object

The Class Brain.


Field Summary
private static org.apache.log4j.Logger log
          The log.
private static java.util.Set<Literal> memory
          The memory.
private static java.util.List<java.lang.String> plan
          The plan.
private static plplan.javaapi.PLPlan planner
          The planner.
private static java.util.Set<Literal> sensors
          The sensors.
private static java.util.PriorityQueue<Literal> targets
          The targets.
 
Constructor Summary
Brain()
          Instantiates a new brain.
 
Method Summary
 void addSense(Literal l)
          Adds a Literal to the sensors set.
 void consumeAction()
          Consume the current action in the plan.
private  Literal evaluate(Literal l, java.lang.String mode)
          Evaluate the literal, in order to find a corresponding local goal.
private  void initPlanner()
          Inits the planner.
 java.lang.String readAction()
          Read the current action in the plan.
 void removeSense(Literal l)
          Removes a Literal from the sensors set.
private  void replan()
          Replan.
 void resetSensors()
          Reset sensors.
 void restart()
          Restart all the brain instance.
 void tryReplan()
          Try to replan.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Logger log
The log.


memory

private static java.util.Set<Literal> memory
The memory.


sensors

private static java.util.Set<Literal> sensors
The sensors.


targets

private static java.util.PriorityQueue<Literal> targets
The targets.


planner

private static plplan.javaapi.PLPlan planner
The planner.


plan

private static java.util.List<java.lang.String> plan
The plan.

Constructor Detail

Brain

public Brain()
Instantiates a new brain.

Method Detail

initPlanner

private void initPlanner()
Inits the planner.


replan

private void replan()
Replan. Run the planner in order to find a better planning.


addSense

public void addSense(Literal l)
Adds a Literal to the sensors set.

Parameters:
l - the literal

removeSense

public void removeSense(Literal l)
Removes a Literal from the sensors set.

Parameters:
l - the literal

evaluate

private Literal evaluate(Literal l,
                         java.lang.String mode)
Evaluate the literal, in order to find a corresponding local goal.

Parameters:
l - the literal
mode - the mode (add, remove)
Returns:
the evaluated literal

resetSensors

public void resetSensors()
Reset sensors.


readAction

public java.lang.String readAction()
Read the current action in the plan.

Returns:
the action

consumeAction

public void consumeAction()
Consume the current action in the plan.


restart

public void restart()
Restart all the brain instance.


tryReplan

public void tryReplan()
Try to replan.