fr.lifl.jedi.model.halo
Class HaloBuilder

java.lang.Object
  extended by fr.lifl.jedi.model.halo.HaloBuilder

public class HaloBuilder
extends java.lang.Object

This class provides tools that help the construction of a surface used by agents to perceive other agents in the environment. Such surfaces are used in the Environment.getNeighborhoodInHalo(Agent, PhysicalHalo, java.util.Set) method to get all the agents perceived by a particular agent.

Version:
JEDI V 2.2
Created the 21st nov. 2008
Modified the 4th may 2009
Author:
Yoann Kubera
SMAC Team (Systèmes Multi-Agents et Comportement)
LIFL (Laboratoire d'Informatique Fondamentale de Lille)
University of Lille, France

Field Summary
static HaloBuilder INSTANCE
          Instance of this singleton class.
 
Method Summary
 PhysicalHalo createConeShapedArea(double radius, double alpha)
          This method creates a cone-shaped perception area, at the end of which the agent lies.
 PhysicalHalo createDiscShapedArea(double radius)
          This method creates a disc shaped perception area, where the agent lies at center.
 PhysicalHalo createRectangleShapedArea(double width, double height)
          This method creates a rectangle shaped perception area, where the agent lies at center.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final HaloBuilder INSTANCE
Instance of this singleton class.

Method Detail

createRectangleShapedArea

public PhysicalHalo createRectangleShapedArea(double width,
                                              double height)
This method creates a rectangle shaped perception area, where the agent lies at center.

Parameters:
width - The width of the rectangular area.
height - The height of the rectangular area.
Returns:
The rectangle shaped area.

createDiscShapedArea

public PhysicalHalo createDiscShapedArea(double radius)
This method creates a disc shaped perception area, where the agent lies at center.

Parameters:
radius - The radius of the disc shaped area.
Returns:
The disc shaped area.

createConeShapedArea

public PhysicalHalo createConeShapedArea(double radius,
                                         double alpha)
This method creates a cone-shaped perception area, at the end of which the agent lies. The cone will cover a particular angle alpha. This cone is placed such that the angle between the (0,1) vector and the border vectors of the cone are - alpha / 2 and alpha / 2.

Parameters:
radius - The radius of the cone-shaped area.
alpha - The angle covered by the cone-shaped area.
Returns:
The cone-shaped area.