agents

## Class Percept

- java.lang.Object
- - agents.Agent
  - - agents.SystemAgent
    - - agents.Percept

All Implemented Interfaces:
  java.io.Serializable

    public class Percept
    extends SystemAgent
    implements java.io.Serializable

Percept agent is in charge of the communication with the environment. Each Percept agent must be connected to one data source.

See Also:
  Serialized Form

### Field Summary

Fields
`PseudoTree` `tree` The tree.

### Constructor Summary

Constructors
Constructor and Description
`Percept(Percept p)` Instantiates a new percept.
`Percept(World world)` Instantiates a new percept.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addTarget(Agent a)` Adds the target.
`void` `ajustMinMax()` Allow the percept to record the lower and higher value perceived.
`void` `computeAMessage(Message m)` Compute A message.
`java.util.ArrayList<Agent>` `getActivatedContext()` Gets the activated context.
`java.util.ArrayList<Context>` `getContextIncluding(double v)` Gets the context including.
`double` `getMinMaxDistance()` Gets the min max distance.
`double` `getOldValue()` Gets the old value.
`BlackBoxAgent` `getSensor()` Gets the sensor.
`java.util.ArrayList<? extends Agent>` `getTargets()` Gets the targets.
`PseudoTree` `getTree()` Gets the tree.
`double` `getValue()` Gets the value.
`boolean` `isEnum()` Checks if is enum.
`void` `play()` This is the core behaviour of the percept agent.
`void` `setActivatedContext(java.util.ArrayList<Agent> activatedContext)` Sets the activated context.
`void` `setEnum(boolean isEnum)` Sets the enum.
`void` `setOldValue(double oldValue)` Sets the old value.
`void` `setSensor(BlackBoxAgent sensor)` Sets the sensor.
`void` `setTargets(java.util.ArrayList<Agent> targets)` Sets the targets.
`void` `setTree(PseudoTree tree)` Sets the tree.
`void` `setValue(double value)` Sets the value.

### Methods inherited from class agents.SystemAgent

`getWorld, setWorld`

### Methods inherited from class agents.Agent

`die, getID, getMessages, getMessagesBin, getName, isDying, readMessage, sendExpressMessage, sendMessage, sendMessage, setDying, setID, setMessages, setMessagesBin, setName`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### tree

    public PseudoTree tree

The tree.

### Constructor Detail

#### Percept

    public Percept(World world)

Instantiates a new percept.

Parameters:
  `world` - the world

#### Percept

    public Percept(Percept p)

Instantiates a new percept.

Parameters:
  `p` - the p

### Method Detail

#### play

    public void play()

This is the core behaviour of the percept agent. Most the other methods are remnant, used to use binary tree

Overrides:
  `play` in class `SystemAgent`

#### getContextIncluding

    public java.util.ArrayList<Context> getContextIncluding(double v)

Gets the context including.

Parameters:
  `v` - the v
Returns:
  the context including

#### computeAMessage

    public void computeAMessage(Message m)

Description copied from class: `Agent`
Compute A message.

Specified by:
  `computeAMessage` in class `Agent`
Parameters:
  `m` - the m

#### ajustMinMax

    public void ajustMinMax()

Allow the percept to record the lower and higher value perceived.

#### getMinMaxDistance

    public double getMinMaxDistance()

Gets the min max distance.

Returns:
  the min max distance

#### getActivatedContext

    public java.util.ArrayList<Agent> getActivatedContext()

Gets the activated context.

Returns:
  the activated context

#### setActivatedContext

    public void setActivatedContext(java.util.ArrayList<Agent> activatedContext)

Sets the activated context.

Parameters:
  `activatedContext` - the new activated context

#### getValue

    public double getValue()

Gets the value.

Returns:
  the value

#### setValue

    public void setValue(double value)

Sets the value.

Parameters:
  `value` - the new value

#### getSensor

    public BlackBoxAgent getSensor()

Gets the sensor.

Returns:
  the sensor

#### setSensor

    public void setSensor(BlackBoxAgent sensor)

Sets the sensor.

Parameters:
  `sensor` - the new sensor

#### getTargets

    public java.util.ArrayList<? extends Agent> getTargets()

Description copied from class: `SystemAgent`
Gets the targets.

Specified by:
  `getTargets` in class `SystemAgent`
Returns:
  the targets

#### setTargets

    public void setTargets(java.util.ArrayList<Agent> targets)

Sets the targets.

Parameters:
  `targets` - the new targets

#### addTarget

    public void addTarget(Agent a)

Adds the target.

Parameters:
  `a` - the a

#### getOldValue

    public double getOldValue()

Gets the old value.

Returns:
  the old value

#### setOldValue

    public void setOldValue(double oldValue)

Sets the old value.

Parameters:
  `oldValue` - the new old value

#### getTree

    public PseudoTree getTree()

Gets the tree.

Returns:
  the tree

#### setTree

    public void setTree(PseudoTree tree)

Sets the tree.

Parameters:
  `tree` - the new tree

#### isEnum

    public boolean isEnum()

Checks if is enum.

Returns:
  true, if is enum

#### setEnum

    public void setEnum(boolean isEnum)

Sets the enum.

Parameters:
  `isEnum` - the new enum