GBE::GRadiatingAgent Class Reference

Periodically radiates an influence. More...

#include <GRadiatingAgent.h>

Inheritance diagram for GBE::GRadiatingAgent:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GRadiatingAgent ()
virtual ~GRadiatingAgent ()
virtual QStringList getAvailableActions () const
virtual QString getActionDescription (const QString &action) const
virtual void performAction (const QString &action, QStringList params)
virtual void run ()
virtual void initFraction (double radiation_fraction)
virtual void initRangeFactor (double range_factor)
virtual void initMinEnergy (double min_energy_amount)
virtual void initMaxEnergy (double max_energy_amount)
virtual void initInterval (unsigned long radiate_interval)

Detailed Description

Periodically radiates an influence.

Radiates a fraction (Fraction) of the own energy as influence every few milliseconds (according to the Msleep attribute). If the element has a form then a GPositionalInfluence is used, otherwise a GElementInfluence.

A range can be specified in which the agent should keep the element's energy amount. If the energy amount is below the minimum then no influence is emitted. If the energy amount is above the maximum then more energy is emitted to get down to the maximum amount.

Adds the following xml data to the element data:

  <radiation>
    <fraction>double value</fraction>
    <rangefactor>double value</rangefactor>
    <minenergy>double value</minenergy>
    <maxenergy>double value</maxenergy>
    <interval>unsigned long integer</interval> <!-- milliseconds -->
  </radiation>

See also:
GPositionalInfluence.


Constructor & Destructor Documentation

GBE::GRadiatingAgent::GRadiatingAgent (  ) 

Constructor. Allows for paramter initialisation.

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

Destructor.


Member Function Documentation

QString GBE::GRadiatingAgent::getActionDescription ( const QString &  action  )  const [virtual]

Needs to be reimplemented in a subclass.

Returns:
Informal description of given action and its parameters.
See also:
getAvailableActions, performAction

Reimplemented from GCS::GAgent.

QStringList GBE::GRadiatingAgent::getAvailableActions (  )  const [virtual]

By default this returns an empty list. It needs to be reimplemented in a subclass.

Note:
Please keep in sync with performAction.
Returns:
list of available actions for this agent
See also:
performAction, getActionDescription

Reimplemented from GCS::GAgent.

void GBE::GRadiatingAgent::initFraction ( double  radiation_fraction  )  [virtual]

Initializes radiation fraction in the element data.

Parameters:
radiation_fraction If current energy amount is between MinEnergyAmount and MaxEnergyAmount then this fraction of own energy amount is emitted.

void GBE::GRadiatingAgent::initInterval ( unsigned long  radiate_interval  )  [virtual]

Initializes radiation interval in the element data.

Parameters:
radiate_interval Determines the time between which influences are radiated. value must be in milliseconds.

void GBE::GRadiatingAgent::initMaxEnergy ( double  max_energy_amount  )  [virtual]

Initializes maximum energy amount in the element data.

Parameters:
max_energy_amount If current energy amount is greater than MaxEnergyAmount the agent will emit just as much to reach max_energy_amount.

void GBE::GRadiatingAgent::initMinEnergy ( double  min_energy_amount  )  [virtual]

Initializes minimum energy amount in the element data.

Parameters:
min_energy_amount The agent won't radiate any influence if current energy amount is less than min_energy_amount.

void GBE::GRadiatingAgent::initRangeFactor ( double  range_factor  )  [virtual]

Initialize range factor for influence radiation. The factor is multiplied with the size of the element to determine the actual range.

Parameters:
range_factor The size factor to determine the influence range.

void GBE::GRadiatingAgent::run (  )  [virtual]

Periodically radiates an influence.

See also:
Msleep.

Reimplemented from GCS::GAgent.


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