fr.lifl.jedi.model.halo
Class ConePhysicalHalo

java.lang.Object
  extended by fr.lifl.jedi.model.halo.ConePhysicalHalo
All Implemented Interfaces:
PhysicalHalo

public class ConePhysicalHalo
extends java.lang.Object
implements PhysicalHalo

This class represents the physical halo of an agent (a ground surface in which other agents are perceived), where agents are perceived in a cone. This class is separated from the PhysicalHaloBasedOnArea class for efficiency reasons.

Version:
JEDI V 2.3
Created the 1st July 2009
Author:
Yoann Kubera
SMAC Team (Systèmes Multi-Agents et Comportement)
LIFL (Laboratoire d'Informatique Fondamentale de Lille)
University of Lille, France

Constructor Summary
ConePhysicalHalo(double radius, double alpha)
          This method creates a cone-shaped perception area, at the end of which the agent lies.
 
Method Summary
 void notTorusPerception(Environment env, Agent source, java.util.Set<Agent> perceivedAgents)
          This sub-method is called whenever the perception is made in a not torus environment.
 void perceive(Environment env, Agent source, java.util.Set<Agent> perceivedAgents)
          This method retrieves from the environment all agents that lie in the ground surface represented by this class.
 void rotate(double angle)
          This method rotates the perceived ground surface according to the direction of the halo's owner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConePhysicalHalo

public ConePhysicalHalo(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.
Method Detail

perceive

public void perceive(Environment env,
                     Agent source,
                     java.util.Set<Agent> perceivedAgents)
Description copied from interface: PhysicalHalo
This method retrieves from the environment all agents that lie in the ground surface represented by this class.

Specified by:
perceive in interface PhysicalHalo
Parameters:
env - The environment where agents are perceived.
source - The agent that perceives thanks to this halo.
perceivedAgents - The list where perceived agents are added.
See Also:
PhysicalHalo.perceive(fr.lifl.jedi.model.Environment, fr.lifl.jedi.model.Agent, java.util.Set)

notTorusPerception

public void notTorusPerception(Environment env,
                               Agent source,
                               java.util.Set<Agent> perceivedAgents)
This sub-method is called whenever the perception is made in a not torus environment.

Parameters:
env - The environment where agents are perceived.
source - The agent that perceives thanks to this halo.
perceivedAgents - The list where perceived agents are added.

rotate

public void rotate(double angle)
Description copied from interface: PhysicalHalo
This method rotates the perceived ground surface according to the direction of the halo's owner.

Specified by:
rotate in interface PhysicalHalo
Parameters:
angle - The angle from which the owner of the halo turns.
See Also:
PhysicalHalo.rotate(double)