#include <GEnergy.h>
Inheritance diagram for GCS::GEnergy:


Public Member Functions | |
| GEnergy () | |
| GEnergy (double level, double amount, double sigma) | |
| GEnergy (const GEnergy &original) | |
| virtual | ~GEnergy () |
| double | level () const |
| double | amount () const |
| double | sigma () const |
| void | set (double level, double amount, double sigma) |
| void | set (const GEnergy original) |
| void | operator= (const GEnergy &original) |
| bool | equals (const GEnergy &other, double epsilon=0.00001) |
| GEnergy | take (double fraction) |
| void | put (const GEnergy &energy) |
Protected Attributes | |
| double | Level |
| double | Amount |
| double | Sigma |
Energy consists of:
See the description of the attributes for details about how energy is represented.
Togehter with the element's form the energy characterises the element. agents make the element "alive".
| GCS::GEnergy::GEnergy | ( | ) |
Construct an empty energy object. All values are initialised to 0.
| GCS::GEnergy::GEnergy | ( | double | level, | |
| double | amount, | |||
| double | sigma | |||
| ) |
This constructor initalises with given attributes.
| GCS::GEnergy::GEnergy | ( | const GEnergy & | original | ) |
Copy constructor
| GCS::GEnergy::~GEnergy | ( | ) | [virtual] |
| double GCS::GEnergy::amount | ( | ) | const |
| bool GCS::GEnergy::equals | ( | const GEnergy & | other, | |
| double | epsilon = 0.00001 | |||
| ) |
| double GCS::GEnergy::level | ( | ) | const |
| void GCS::GEnergy::operator= | ( | const GEnergy & | original | ) |
Copies values from given energy.
| void GCS::GEnergy::put | ( | const GEnergy & | energy | ) |
Adds given energy.
| void GCS::GEnergy::set | ( | const GEnergy | original | ) |
Copies values from given energy.
| void GCS::GEnergy::set | ( | double | level, | |
| double | amount, | |||
| double | sigma | |||
| ) |
Sets the energy to given values.
| double GCS::GEnergy::sigma | ( | ) | const |
| GEnergy GCS::GEnergy::take | ( | double | fraction | ) |
Removes given fraction of this energy and returns it. This can be useful for sending out influences with some fraction of the elements own energy.
double GCS::GEnergy::Amount [protected] |
Since it is not possible (hardware limitations) to represent every atom as a seperate element the amount attribute is used to tell how much of this energy is in the element.
double GCS::GEnergy::Level [protected] |
The energy level is just like a frequency - put on a very large scale it can either represent sound (low frequency) or light (high frequency). Even different light colours are just represented by different energy levels. Thus every object gets its individual characteristic by its energy.
double GCS::GEnergy::Sigma [protected] |
Sigma tells the range of the energy "level" ( in frequency, not space ); the smaller sigma is the more "distinct" and less changeable the energy is; it should thus be only influencable by a narrow band of frequency (with low sigma). This is needed because we don't work on (sub-)atomic levels where there is really only one energy level. So we get a collection of energies with a general average level (this is where the attribute "level" is set to) and a divergence around this average value. The result is a certain amount of energy with a energy level of a "normal distribution".
1.4.7