#include <Objects.h>
Public Methods | |
Stamina (double dSta=4000.0, double dEff=1.0, double dRec=1.0) | |
void | show (ostream &os=cout) |
TiredNessT | getTiredNess (double dRecDecThr, double dStaminaMax) |
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 291 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 1073 of file Objects.cpp. References setEffort(), setRecovery(), and 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 1138 of file Objects.cpp. 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 1171 of file Objects.cpp. References m_dRecovery. Referenced by Player::deMeer5(), and WorldModel::predictStaminaAfterDash(). |
|
This method returns the current stamina value.
Definition at line 1111 of file Objects.cpp. References m_dStamina. Referenced by Player::deMeer5(), getTiredNess(), Player::performPenalty(), and WorldModel::predictStaminaAfterDash(). |
|
This method returns a TiredNessT enumeration that indicates how tired this associated agent with this Stamina value is. Definition at line 1092 of file Objects.cpp. References getStamina(), TIREDNESS_AVERAGE, TIREDNESS_BAD, TIREDNESS_GOOD, TIREDNESS_TERRIBLE, TIREDNESS_VERY_BAD, and TiredNessT. Referenced by WorldModel::getAgentTiredNess(). |
|
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 1148 of file Objects.cpp. References m_dEffort. Referenced by AgentObject::AgentObject(), WorldModel::predictStaminaAfterDash(), WorldModel::processNewAgentInfo(), and Stamina(). |
|
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 1181 of file Objects.cpp. References m_dRecovery. Referenced by AgentObject::AgentObject(), WorldModel::predictStaminaAfterDash(), and Stamina(). |
|
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 1120 of file Objects.cpp. References m_dStamina. Referenced by AgentObject::AgentObject(), WorldModel::predictStaminaAfterDash(), WorldModel::processNewAgentInfo(), and Stamina(). |
|
This method prints the stamina values (stamina, effort and recovery) to the specified output stream.
Definition at line 1083 of file Objects.cpp. References m_dEffort, m_dRecovery, and m_dStamina. Referenced by AgentObject::show(). |
|
Effort value (0..1) |
|
Recovery (0..1) Definition at line 295 of file Objects.h. Referenced by getRecovery(), setRecovery(), and show(). |
|
Stamina value (>0) Definition at line 293 of file Objects.h. Referenced by getStamina(), setStamina(), and show(). |