#include <Objects.h>
Public Methods | |
Stamina (double dSta=4000.0, double dEff=1.0, double dRec=1.0) | |
void | show (ostream &os=cout) |
double | getStamina () const |
bool | setStamina (double d) |
double | getEffort () const |
bool | setEffort (double d) |
double | getRecovery () const |
bool | setRecovery (double d) |
Private Attributes | |
double | m_dStamina |
double | m_dEffort |
double | m_dRecovery |
Definition at line 253 of file Objects.h.
|
This is the constructor for this class. It sets the stamina, effort and recovery on the supplied values.
Definition at line 835 of file Objects.C. References AgentObject::setStamina(). |
|
This method returns the effort. The effort denotes the percentage of the power in a dash that is actually used. Normally this is 1.0 (100%), but when it comes below a threshold, it decreases. It will again rise when stamina becomes higher than a certain threshold defined in ServerSettings.
Definition at line 881 of file Objects.C. References m_dEffort. Referenced by WorldModel::getAgentEffort(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), WorldModel::predictStaminaAfterDash(), and WorldModel::predictStateAfterDash(). |
|
This method returns the recovery. Recovery denotes the percentage of the stamina increase that is added to the stamina every cycle. If recovery is 1.0 all of the increase of stamina is added to the current stamina. When stamina becomes below a certain threshold defined in ServerSettings, the recovery is decreased. It can never increase!
Definition at line 914 of file Objects.C. References m_dRecovery. Referenced by Player::deMeer5(), and WorldModel::predictStaminaAfterDash(). |
|
This method returns the current stamina value.
Definition at line 854 of file Objects.C. References m_dStamina. Referenced by Player::deMeer5(), and WorldModel::predictStaminaAfterDash(). |
|
This method sets the effort value. This value should be between 0 and 1, otherwise the value is set to the closest value in this interval (0 for negative values, 1 for higher values) and false is returned.
Definition at line 891 of file Objects.C. References m_dEffort. Referenced by AgentObject::AgentObject(), WorldModel::predictStaminaAfterDash(), and WorldModel::processNewAgentInfo(). |
|
This method sets the recovery value. This value should be between 0 and 1, otherwise the value is set to the closest value in this interval (0 for negative values, 1 for higher values) and false is returned.
Definition at line 924 of file Objects.C. References m_dRecovery. Referenced by AgentObject::AgentObject(), and WorldModel::predictStaminaAfterDash(). |
|
This method sets the stamina value. This value should be positive, otherwise the value is set to 0 and false is returned.
Definition at line 863 of file Objects.C. References m_dStamina. Referenced by AgentObject::AgentObject(), WorldModel::predictStaminaAfterDash(), and WorldModel::processNewAgentInfo(). |
|
This method prints the stamina values (stamina, effort and recovery) to the specified output stream.
Definition at line 845 of file Objects.C. References m_dEffort, m_dRecovery, and m_dStamina. Referenced by AgentObject::show(). |
|
Effort value (0..1) |
|
Recovery (0..1) Definition at line 257 of file Objects.h. Referenced by getRecovery(), setRecovery(), and show(). |
|
Stamina value (>0) Definition at line 255 of file Objects.h. Referenced by getStamina(), setStamina(), and show(). |