GBE::GAttractAgent Class Reference

Moves towards elements with similar energy. More...

#include <GAttractAgent.h>

Inheritance diagram for GBE::GAttractAgent:

Inheritance graph
[legend]
Collaboration diagram for GBE::GAttractAgent:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void receiveInfluence (const GCS::GElementInfluence &influence)
virtual void initFactor (double factor)

Public Member Functions

 GAttractAgent ()
virtual ~GAttractAgent ()

Detailed Description

Moves towards elements with similar energy.

Author:
Raphael Langerhorst
When an influence is received and the influence type is GPositionalInfluence then the agent accelerates towards the source of the influence. This is only done when a form is available, since formless elements are also positionless.

Adds the following xml data to the element data:

  <dynamics><attractionfactor>double value</attractionfactor></dynamics>

Todo:
remove attributes, use element data


Constructor & Destructor Documentation

GBE::GAttractAgent::GAttractAgent (  ) 

Constructor

GBE::GAttractAgent::~GAttractAgent (  )  [virtual]

Virtual destructor for subclassing.


Member Function Documentation

void GBE::GAttractAgent::initFactor ( double  factor  )  [virtual, slot]

Initializes given attraction factor value in element data.

Parameters:
factor acceleration factor towards an influence source

void GBE::GAttractAgent::receiveInfluence ( const GCS::GElementInfluence influence  )  [virtual, slot]

Reimplements GAgent::receiveInfluence(). Acceleration towards the source of the influence is implemented here. The attraction force also depends on how much alike the influence energy level and the own energy level are.

See also:
GCS::GEnergy, GCS::GElementInfluence.


The documentation for this class was generated from the following files:
Generated on Thu Nov 16 07:49:18 2006 for G System by  doxygen 1.4.7