Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

BasicPlayer.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2000-2003, Jelle Kok, University of Amsterdam
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007 
00008 1. Redistributions of source code must retain the above copyright notice, this
00009 list of conditions and the following disclaimer.
00010 
00011 2. Redistributions in binary form must reproduce the above copyright notice,
00012 this list of conditions and the following disclaimer in the documentation
00013 and/or other materials provided with the distribution.
00014 
00015 3. Neither the name of the University of Amsterdam nor the names of its
00016 contributors may be used to endorse or promote products derived from this
00017 software without specific prior written permission.
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00020 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00021 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00022 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
00023 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00024 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00025 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00026 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00027 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00028 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 */
00030 
00048 #ifndef _BASICPLAYER_
00049 #define _BASICPLAYER_
00050 
00051 #include "ActHandler.h"
00052 
00053 extern Logger Log; 
00059 class BasicPlayer
00060 {
00061 protected:
00062   ActHandler      *ACT; 
00063   WorldModel      *WM;  
00064   ServerSettings  *SS;  
00065   PlayerSettings  *PS;  
00067 
00068 
00069   SoccerCommand   alignNeckWithBody       (                                  );
00070   SoccerCommand   turnBodyToPoint         ( VecPosition   pos,
00071                                             int           iPos = 1           );
00072   SoccerCommand   turnBackToPoint         ( VecPosition   pos,
00073                                             int           iPos = 1           );
00074   SoccerCommand   turnNeckToPoint         ( VecPosition   pos,
00075                                             SoccerCommand com                );
00076   SoccerCommand   searchBall              (                                  );
00077   SoccerCommand   dashToPoint             ( VecPosition   pos,
00078                                             int           iCycles = 1        );
00079   SoccerCommand   freezeBall              (                                  );
00080   SoccerCommand   kickBallCloseToBody     ( AngDeg        ang,
00081               double        dKickRatio = 0.16  );
00082   SoccerCommand   accelerateBallToVelocity( VecPosition   vel                );
00083   SoccerCommand   catchBall               (                                  );
00084   SoccerCommand   communicate             ( char          *str               );
00085   SoccerCommand   teleportToPos           ( VecPosition   pos                );
00086   SoccerCommand   listenTo                ( ObjectT       obj                );
00087   SoccerCommand   tackle                  (                                  );
00088 
00090 
00091   SoccerCommand   turnBodyToObject        ( ObjectT       o                  );
00092   SoccerCommand   turnNeckToObject        ( ObjectT       o,
00093                                             SoccerCommand com                );
00094   SoccerCommand   directTowards           ( VecPosition   posTo,
00095                                             AngDeg        angWhenToTurn,
00096                                             VecPosition   *pos = NULL,
00097                                             VecPosition   *vel = NULL,
00098                                             AngDeg        *angBody  = NULL   );
00099   SoccerCommand   moveToPos               ( VecPosition   posTo,
00100                                             AngDeg        angWhenToTurn,
00101                                             double        dDistDashBack = 0.0,
00102                                             bool          bMoveBack = false,
00103                                             int           iCycles = 1        );
00104   SoccerCommand   collideWithBall         (                                  );
00105   SoccerCommand   interceptClose          (                                  );
00106   SoccerCommand   interceptCloseGoalie    (                                  );
00107   SoccerCommand   kickTo                  ( VecPosition   posTarget,
00108                                             double        dEndSpeed          );
00109   SoccerCommand   turnWithBallTo          ( AngDeg        ang,
00110                                             AngDeg        angKickThr,
00111                                             double        dFreezeThr         );
00112   SoccerCommand   moveToPosAlongLine      ( VecPosition   pos,
00113                                             AngDeg        ang,
00114                                             double        dDistThr,
00115                                             int           iSign,
00116                                             AngDeg        angThr,
00117                                             AngDeg        angCorr            );
00118 
00119 
00121 
00122   SoccerCommand   intercept               ( bool          isGoalie           );
00123   SoccerCommand   dribble                 ( AngDeg        ang,
00124                                             DribbleT      d                  );
00125   SoccerCommand   directPass              ( VecPosition   pos,
00126                                             PassT         passType           );
00127   SoccerCommand   leadingPass             ( ObjectT       o,
00128                                             double        dDist,
00129                                             DirectionT    dir = DIR_NORTH    );
00130   SoccerCommand   throughPass             ( ObjectT       o,
00131                                             VecPosition   posEnd,
00132                                             AngDeg        *angMax = NULL     );
00133   SoccerCommand   outplayOpponent         ( ObjectT       o,
00134                                             VecPosition   pos,
00135                                             VecPosition   *posTo = NULL      );
00136   SoccerCommand   clearBall               ( ClearBallT    type,
00137                                             SideT         s = SIDE_ILLEGAL,
00138                                             AngDeg        *angMax = NULL     );
00139   SoccerCommand   mark                    ( ObjectT       o,
00140                                             double        dDist,
00141                                             MarkT         mark               );
00142   SoccerCommand   defendGoalLine          ( double        dDist              );
00143   SoccerCommand   interceptScoringAttempt (                                  );
00144   SoccerCommand   holdBall                (                                  );
00145 
00147 
00148   VecPosition     getThroughPassShootingPoint( ObjectT       objTeam,
00149                                                VecPosition   posEnd,
00150                  AngDeg        *angMax         );
00151   VecPosition     getInterceptionPointBall(    int           *iCyclesBall,
00152                                                bool          isGoalie        );
00153   VecPosition     getActiveInterceptionPointBall
00154                                           ( int           *iCyclesBall,
00155                                             bool          isGoalie           );
00156   VecPosition     getDribblePoint         ( DribbleT      dribble,
00157                                             double        *dDist             );
00158   VecPosition     getShootPositionOnLine  ( VecPosition   p1,
00159                                             VecPosition   p2,
00160                                             AngDeg        *angLargest = NULL );
00161   double          getEndSpeedForPass      ( ObjectT       o,
00162                                             VecPosition   posPass            );
00163   VecPosition     getMarkingPosition      ( ObjectT       o,
00164                                             double        dDist,
00165                                             MarkT         mark               );
00166 } ;
00167 
00168 #endif

Generated on Fri Nov 7 11:45:39 2003 for UvA Trilearn 2003 Base Code by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001