#include <GRadiatingAgent.h>
Inheritance diagram for GBE::GRadiatingAgent:


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) |
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>
| GBE::GRadiatingAgent::GRadiatingAgent | ( | ) |
Constructor. Allows for paramter initialisation.
| GBE::GRadiatingAgent::~GRadiatingAgent | ( | ) | [virtual] |
Destructor.
| QString GBE::GRadiatingAgent::getActionDescription | ( | const QString & | action | ) | const [virtual] |
Needs to be reimplemented in a subclass.
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.
Reimplemented from GCS::GAgent.
| void GBE::GRadiatingAgent::initFraction | ( | double | radiation_fraction | ) | [virtual] |
Initializes radiation fraction in the element data.
| 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.
| 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.
| 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.
| 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.
| range_factor | The size factor to determine the influence range. |
| void GBE::GRadiatingAgent::run | ( | ) | [virtual] |
1.4.7