クラス rcsc::PlayerType

heterogeneous player parametor class [詳細]

#include <player_type.h>

すべてのメンバ一覧

Public メソッド

 PlayerType ()
 default constructo
 PlayerType (const ServerParam &sparam, const int id, const double &pspdmax, const double &sincmax, const double &pdecay, const double &imoment, const double &dprate, const double &psize, const double &kmargin, const double &krand, const double &estamina, const double &effmax, const double &effmin)
 constructor with all parameters
 PlayerType (const ServerParam &sparam)
 construct default type parameter using ServerParam
 PlayerType (const ServerParam &sparam, const char *msg, const double &version)
 construct with message from rcssserver
 PlayerType (const ServerParam &sparam, const rcg::player_type_t &from)
 construct with monitor protocol
void convertTo (rcg::player_type_t &to) const
 conver to the monitor protocol format
std::string toStr () const
 convert to the rcss parameter message
int id () const
const double & playerSpeedMax () const
const double & staminaIncMax () const
const double & playerDecay () const
const double & inertiaMoment () const
const double & dashPowerRate () const
const double & playerSize () const
const double & kickableMargin () const
const double & kickRand () const
const double & extraStamina () const
const double & effortMax () const
const double & effortMin () const
const double & kickableArea () const
const double & realSpeedMax () const
const double & playerSpeedMax2 () const
const double & realSpeedMax2 () const
const std::vector< double > & dashDistanceTable () const
 get dash reachable distance table
int getMaxDashCyclesSavingStamina (const ServerParam &sparam, const double &dash_power, const double &current_stamina, const double &current_recovery) const
 calculate enable cycles to keep to dash using max power
int cyclesToReachMaxSpeed (const double &dash_power) const
 estimate cycles to reach max speed from zero.
int cyclesToReachMaxSpeed () const
 estimate cycles to reach max speed from zero using max dash power.
int cyclesToReachDistance (const double &dash_dist) const
 estimate cycles to reach the specific distance with start speed 0.
bool canOverSpeedMax (const double &dash_power, const double &effort) const
 check if this type player can over player_speed_max
double getDashPowerToKeepMaxSpeed (const ServerParam &sparam, const double &effort) const
 estimate dash power to keep max speed
double getDashPowerToKeepMaxSpeed (const ServerParam &sparam) const
 estimate dash power to keep max speed with max effort value
double getDashPowerToKeepSpeed (const double &speed, const double &effort) const
 estimate dash power to keep the specified speed
double getOneStepStaminaComsumption (const ServerParam &sparam) const
 estimate one cycle stamina comsumption to keep mas speed
double kickRate (const ServerParam &sparam, const double &ball_dist, const double &dir_diff) const
 calculate kick rate
double dashRate (const double &effort) const
 calculate dash rate
double effectiveTurn (const double &command_moment, const double &speed) const
 calculate effective turn angle
double finalSpeed (const double &dash_power, const double &effort) const
 calculate final reachable speed
Vector2D inertiaTravel (const Vector2D &initial_vel, const int n_step) const
 calculate inertia movement vector
Vector2D inertiaPoint (const Vector2D &initial_pos, const Vector2D &initial_vel, const int n_step) const
 calculate reach point
Vector2D inertiaFinalTravel (const Vector2D &initial_vel) const
 calculate total ineartia movement vector
Vector2D inertiaFinalPoint (const Vector2D &initial_pos, const Vector2D &initial_vel) const
 calculate final reach point
bool normalizeAccel (const Vector2D &velocity, const AngleDeg &accel_angle, double *accel_mag) const
 normalize accel range when try to new dash(accel_mag, accel_angle)
bool normalizeAccel (const Vector2D &velocity, Vector2D *accel) const
 normalize accel range when try to new dash(accel)
void predictStaminaAfterWait (const ServerParam &sparam, const int n_wait, double *stamina, double *effort, const double &recovery) const
 predict agent's stamina and effort
void predictStaminaAfterDash (const ServerParam &sparam, const double &dash_power, double *stamina, double *effort, double *recovery) const
 predict agent's stamina related values after one dash
void predictStaminaAfterNrDash (const ServerParam &sparam, const double &dash_power, const int n_dash, double *stamina, double *effort, double *recovery) const
 predict stamina related values after nr dashes
std::ostream & print (std::ostream &os) const
 output parameters to stream


説明

heterogeneous player parametor class


コンストラクタとデストラクタ

rcsc::PlayerType::PlayerType (  )  [inline]

default constructo

just set Hetero_Unknown to Id

rcsc::PlayerType::PlayerType ( const ServerParam sparam,
const int  id,
const double &  pspdmax,
const double &  sincmax,
const double &  pdecay,
const double &  imoment,
const double &  dprate,
const double &  psize,
const double &  kmargin,
const double &  krand,
const double &  estamina,
const double &  effmax,
const double &  effmin 
)

constructor with all parameters

引数:
sparam server parameter
id hetero Id
pspdmax player_speed_max parameter
sincmax stamina_inc_max parameter
pdecay player_decay parameter
imoment inertia_moment parameter
dprate dash_power_rate parameter
psize player_size parameter
kmargin kickable_margin parameter
krand kick_rand parameter
estamina extra_stamina parameter
effmax effort_max parameter
effmin effort_min parameter

rcsc::PlayerType::PlayerType ( const ServerParam sparam  )  [explicit]

construct default type parameter using ServerParam

引数:
sparam const reference to the ServerParam

rcsc::PlayerType::PlayerType ( const ServerParam sparam,
const char *  msg,
const double &  version 
)

construct with message from rcssserver

引数:
sparam const reference to the ServerParam
msg raw message from rcssserver
version client version that determins message protocol

rcsc::PlayerType::PlayerType ( const ServerParam sparam,
const rcg::player_type_t from 
)

construct with monitor protocol

引数:
sparam const reference to the ServerParam
from monitor protocol data


関数

void rcsc::PlayerType::convertTo ( rcg::player_type_t to  )  const

conver to the monitor protocol format

引数:
to reference to the data variable.

std::string rcsc::PlayerType::toStr (  )  const

convert to the rcss parameter message

戻り値:
parameter message string

const std::vector< double >& rcsc::PlayerType::dashDistanceTable (  )  const [inline]

get dash reachable distance table

戻り値:
const reference to the distance table container

int rcsc::PlayerType::getMaxDashCyclesSavingStamina ( const ServerParam sparam,
const double &  dash_power,
const double &  current_stamina,
const double &  current_recovery 
) const

calculate enable cycles to keep to dash using max power

引数:
sparam server parameter
dash_power used dash power
current_stamina current agent's stamina
current_recovery current agent's recovery
戻り値:
max cycles to keep same dash power

int rcsc::PlayerType::cyclesToReachMaxSpeed ( const double &  dash_power  )  const

estimate cycles to reach max speed from zero.

引数:
dash_power used dash power
戻り値:
estimated cycles to reach.

int rcsc::PlayerType::cyclesToReachMaxSpeed (  )  const [inline]

estimate cycles to reach max speed from zero using max dash power.

戻り値:
estimated cycles to reach.
returned value is calculated by initAdditionalParams()

int rcsc::PlayerType::cyclesToReachDistance ( const double &  dash_dist  )  const

estimate cycles to reach the specific distance with start speed 0.

引数:
dash_dist distance to reach
戻り値:
estimated cycles to reach

bool rcsc::PlayerType::canOverSpeedMax ( const double &  dash_power,
const double &  effort 
) const [inline]

check if this type player can over player_speed_max

引数:
dash_power used dash_power
effort current effort value
戻り値:
true if player has the potential to go over the max speed

double rcsc::PlayerType::getDashPowerToKeepMaxSpeed ( const ServerParam sparam,
const double &  effort 
) const

estimate dash power to keep max speed

引数:
sparam server parameter
effort current agent's effort
戻り値:
conserved dash power

double rcsc::PlayerType::getDashPowerToKeepMaxSpeed ( const ServerParam sparam  )  const [inline]

estimate dash power to keep max speed with max effort value

引数:
sparam server parameter
戻り値:
conserved dash power

double rcsc::PlayerType::getDashPowerToKeepSpeed ( const double &  speed,
const double &  effort 
) const [inline]

estimate dash power to keep the specified speed

引数:
speed the desired speed
effort current effort value
戻り値:
estimated dash power, but not normalized

double rcsc::PlayerType::getOneStepStaminaComsumption ( const ServerParam sparam  )  const [inline]

estimate one cycle stamina comsumption to keep mas speed

引数:
sparam server parameter
戻り値:
get the comsumed stamina value

double rcsc::PlayerType::kickRate ( const ServerParam sparam,
const double &  ball_dist,
const double &  dir_diff 
) const

calculate kick rate

引数:
sparam server parameter
ball_dist ball distance from agent
dir_diff ball angle difference from agent body angle
戻り値:
kick rate value

double rcsc::PlayerType::dashRate ( const double &  effort  )  const [inline]

calculate dash rate

引数:
effort current effort value
戻り値:
dash power rate multiplied by effort

double rcsc::PlayerType::effectiveTurn ( const double &  command_moment,
const double &  speed 
) const [inline]

calculate effective turn angle

引数:
command_moment turn command argument
speed current speed
戻り値:
estimated result turn angle

double rcsc::PlayerType::finalSpeed ( const double &  dash_power,
const double &  effort 
) const [inline]

calculate final reachable speed

引数:
dash_power used dash power
effort current effort
戻り値:
maximal speed value with the specified params

Vector2D rcsc::PlayerType::inertiaTravel ( const Vector2D initial_vel,
const int  n_step 
) const [inline]

calculate inertia movement vector

引数:
initial_vel initial velocity vector
n_step cycles to be estimated
戻り値:
total travel vector

Vector2D rcsc::PlayerType::inertiaPoint ( const Vector2D initial_pos,
const Vector2D initial_vel,
const int  n_step 
) const [inline]

calculate reach point

引数:
initial_pos initial point
initial_vel initial velocity vector
n_step cycles to be estimated the reached point

Vector2D rcsc::PlayerType::inertiaFinalTravel ( const Vector2D initial_vel  )  const [inline]

calculate total ineartia movement vector

引数:
initial_vel initial velocity vector
戻り値:
total travel vector when plyer stops

Vector2D rcsc::PlayerType::inertiaFinalPoint ( const Vector2D initial_pos,
const Vector2D initial_vel 
) const [inline]

calculate final reach point

引数:
initial_pos initial position
initial_vel initial velocity vector
戻り値:
the reached point when player stops

bool rcsc::PlayerType::normalizeAccel ( const Vector2D velocity,
const AngleDeg accel_angle,
double *  accel_mag 
) const

normalize accel range when try to new dash(accel_mag, accel_angle)

引数:
velocity current agent's velocity
accel_angle accel angle -> agent's body angle or reversed body angle.
accel_mag pointer to accel magnitude variable
戻り値:
true if normalized, false otherwise.

bool rcsc::PlayerType::normalizeAccel ( const Vector2D velocity,
Vector2D accel 
) const

normalize accel range when try to new dash(accel)

引数:
velocity current agent's velocity
accel new accel
戻り値:
true if normalized, false otherwise

void rcsc::PlayerType::predictStaminaAfterWait ( const ServerParam sparam,
const int  n_wait,
double *  stamina,
double *  effort,
const double &  recovery 
) const

predict agent's stamina and effort

引数:
sparam server parameter
n_wait number of wait cycles
stamina pointer to stamina variable
effort pointer to effort variable
recovery current agent's recovery

void rcsc::PlayerType::predictStaminaAfterDash ( const ServerParam sparam,
const double &  dash_power,
double *  stamina,
double *  effort,
double *  recovery 
) const

predict agent's stamina related values after one dash

引数:
sparam server parameter
dash_power used dash power
stamina pointer to stamina variable
effort pointer to effort variable
recovery pointer to recovery variable

void rcsc::PlayerType::predictStaminaAfterNrDash ( const ServerParam sparam,
const double &  dash_power,
const int  n_dash,
double *  stamina,
double *  effort,
double *  recovery 
) const

predict stamina related values after nr dashes

引数:
sparam server parameter
dash_power used dash power
n_dash number of dash cycles
stamina pointer to stamina variable
effort pointer to effort variable
recovery pointer to recovery variable

std::ostream & rcsc::PlayerType::print ( std::ostream &  os  )  const

output parameters to stream

引数:
os reference to the output stream
戻り値:
reference to the output stream


このクラスの説明は次のファイルから生成されました:
librcscに対してThu May 1 15:41:25 2008に生成されました。  doxygen 1.5.0