📄 worldmodel.h
字号:
bool getMinMaxDirChange ( double dOutput, double *dMin, double *dMax, double x1 ); bool getMinMaxDistChange ( double dOutput, double dDist, double *dMin, double *dMax, double x1, double xDist1, double xDist2 ); double invQuantizeMin ( double dOutput, double dQuantizeStep ); double invQuantizeMax ( double dOutput, double dQuantizeStep ); public: // various update methods void mapUnknownPlayers ( Time time ); bool updateSSToHeteroPlayerType ( int iPlayerType ); bool resetTimeObjects ( ); void removeGhosts ( ); ////////////////////////// PREDICTIONS (WorldModelPredict.C) //////////////// // predictions of worldmodel about future states of different objects bool predictStateAfterCommand ( SoccerCommand com, VecPosition *pos, VecPosition *vel, AngDeg *angGlobalBody, AngDeg *angGlobalNeck, ObjectT obj=OBJECT_ILLEGAL, Stamina *sta = NULL ); bool predictAgentStateAfterCommand ( SoccerCommand com, VecPosition *pos, VecPosition *vel, AngDeg *angBody, AngDeg *angNeck, Stamina *sta ); bool predictObjectStateAfterCommand ( ObjectT obj, SoccerCommand com, VecPosition *pos, VecPosition *vel, AngDeg *angBody, AngDeg *angNeck, Stamina *sta ); VecPosition predictAgentPosAfterCommand ( SoccerCommand com ); void predictStateAfterDash ( double dActualPower, VecPosition *pos, VecPosition *vel, Stamina *sta, double dDirection, ObjectT o=OBJECT_ILLEGAL ); void predictStateAfterTurn ( AngDeg dSendAngle, VecPosition *pos, VecPosition *vel, AngDeg *angBody, AngDeg *angNeck, ObjectT obj=OBJECT_ILLEGAL, Stamina *sta = NULL ); void predictBallInfoAfterCommand ( SoccerCommand soc, VecPosition *pos = NULL, VecPosition *vel = NULL ); VecPosition predictPosAfterNrCycles ( ObjectT o, double dCycles, int iDashPower = 100, VecPosition *posIn = NULL, VecPosition *velIn = NULL, bool bUpdate = true ); VecPosition predictAgentPos ( int iCycles, int iDashPower = 0 ); VecPosition predictFinalAgentPos ( VecPosition *pos = NULL, VecPosition *vel = NULL ); int predictNrCyclesForDistance ( ObjectT o, double dDist, double dCurSpeed ); int predictNrCyclesToPoint ( ObjectT o, VecPosition posTo ); int predictNrCyclesToObject ( ObjectT objFrom, ObjectT objTo ); void predictStaminaAfterDash ( double dPower, Stamina *sta ); SoccerCommand predictCommandTurnTowards ( ObjectT obj, VecPosition posTo, int iCycles, double dDistBack, bool bMoveBack, VecPosition *pos = NULL, VecPosition *vel = NULL, AngDeg *angBody = NULL ); SoccerCommand predictCommandToMoveToPos ( ObjectT obj, VecPosition posTo, int iCycles, double dDistBack = 2.5, bool bMoveBack = false, VecPosition *pos = NULL, VecPosition *vel = NULL, AngDeg *angBody = NULL ); SoccerCommand predictCommandToInterceptBall ( ObjectT obj, SoccerCommand soc, int *iCycles = NULL , VecPosition *posIntercept=NULL, VecPosition *pos = NULL, VecPosition *vel = NULL, AngDeg *angBody = NULL ); bool isCollisionAfterCommand ( SoccerCommand soc ); ////////////////////////// HIGH-LEVEL METHODS (WorldModelHighLevel.C) /////// // methods that return the number of players in a certain area of the field int getNrInSetInRectangle ( ObjectSetT objectSet, Rect *rect = NULL ); int getNrInSetInCircle ( ObjectSetT objectSet, Circle c ); int getNrInSetInCone ( ObjectSetT objectSet, double dWidth, VecPosition start, VecPosition end ); bool isEmptySpace ( ObjectT obj, AngDeg ang, double dDist = 4.0 ); bool coordinateWith ( ObjectT obj ); // method that return the closest or fastest player to a certain pos orobject ObjectT getClosestInSetTo ( ObjectSetT objectSet, ObjectT o , double *dDist = NULL, double dConfThr = -1.0 ); ObjectT getClosestInSetTo ( ObjectSetT objectSet, VecPosition pos, double *dDist = NULL, double dConfThr = -1.0 ); ObjectT getClosestInSetTo ( ObjectSetT objectSet, Line l, VecPosition pos1, VecPosition pos2, double *dDistToLine= NULL, double *dDistPos1To=NULL ); ObjectT getClosestRelativeInSet ( ObjectSetT set, double *dDist = NULL ); ObjectT getSecondClosestInSetTo ( ObjectSetT objectSet, ObjectT o, double *dDist = NULL, double dConfThr = -1.0 ); ObjectT getSecondClosestRelativeInSet ( ObjectSetT set, double *dDist = NULL ); void createInterceptFeatures ( ); ObjectT getFastestInSetTo ( ObjectSetT objectSet, ObjectT o, int *iCycles = NULL ); ObjectT getFastestInSetTo ( ObjectSetT objectSet, VecPosition pos, VecPosition vel, double dDecay, int *iCycles = NULL ); ObjectT getFurthestInSetTo ( ObjectSetT objectSet, ObjectT o , double *dDist = NULL, double dConfThr = -1.0 ); ObjectT getFurthestRelativeInSet ( ObjectSetT set, double *dDist = NULL ); VecPosition getPosClosestOpponentTo ( double *dDist = NULL, ObjectT o =OBJECT_ILLEGAL ); double getMaxTraveledDistance ( ObjectT o ); // various methods dealing with sets of objects ObjectT getFirstEmptySpotInSet ( ObjectSetT objectSet, int iUnknownPlayer=-1 ); // boolean methods that indicate whether an object fulfills a constraint bool isVisible ( ObjectT o ); bool isBallKickable ( ); bool isBallCatchable ( ); bool isBallHeadingToGoal ( ); bool isBallInOurPossesion ( ); bool isBallInOwnPenaltyArea ( ); bool isInOwnPenaltyArea ( VecPosition pos ); bool isInTheirPenaltyArea ( VecPosition pos ); bool isConfidenceGood ( ObjectT ); bool isConfidenceVeryGood ( ObjectT ); bool isOnside ( ObjectT ); bool isOpponentAtAngle ( AngDeg ang, double dDist ); // various methods that supply specific information about the field Time getTimeFromConfidence ( double dConf ); double getOffsideX ( bool bIncludeComm=true ); VecPosition getOuterPositionInField ( VecPosition pos, AngDeg ang, double dDist = 3.0, bool bWithPenalty=true ); AngDeg getDirectionOfWidestAngle ( VecPosition posOrg, AngDeg angMin, AngDeg angMax, AngDeg *ang, double dDist ); bool isInField ( VecPosition pos, double dMargin = 1 ); bool isBeforeGoal ( VecPosition pos ); // strategic positioning VecPosition getStrategicPosition ( ObjectT obj, FormationT ft = FT_ILLEGAL ); VecPosition getStrategicPosition ( int iPlayer = -1, FormationT ft = FT_ILLEGAL ); VecPosition getMarkingPosition ( VecPosition pos, double dDist, MarkT mark ); int getClosestPlayerInFormationTo ( VecPosition pos, bool bWithGoalie = 1, ObjectT obj=OBJECT_ILLEGAL, PlayerSetT ps = PS_ALL, FormationT ft = FT_ILLEGAL ); // methods for computing the actual argument for a soccer command. double getActualKickPowerRate ( ); double getKickPowerForSpeed ( double dDesiredSpeed ); double getKickSpeedToTravel ( double dDistance, double dEndSpeed ); double getFirstSpeedFromEndSpeed ( double dEndSpeed, double dCycles, double dDecay = -1.0 ); double getFirstSpeedFromDist ( double dDist, double dCycles, double dDecay = -1.0 ); double getEndSpeedFromFirstSpeed ( double dFirstSpeed, double dCycles ); AngDeg getAngleForTurn ( AngDeg angDesiredAngle, double dSpeed, ObjectT o=OBJECT_ILLEGAL ); AngDeg getActualTurnAngle ( AngDeg angActualAngle, double dSpeed, ObjectT o=OBJECT_ILLEGAL ); double getPowerForDash ( VecPosition posRelTo, AngDeg angBody, VecPosition vel, double dEffort, int iCycles = 1 ); ////////////////////////// VARIOUS (WorldModel.C) /////////////////////////// // constructor WorldModel ( ServerSettings *ss, PlayerSettings *ps, Formations *fs ); ~WorldModel ( ); // print information about WorldModel void show ( ostream &os = cout ); void show ( ObjectSetT set, ostream &os = cout ); void showQueuedCommands ( ostream &os = cout ); void show ( ObjectT o, ostream &os = cout ); // methods that deal with timing information bool waitForNewInformation ( ); // methods that deal with debugging void logObjectInformation ( int iLogLevel, ObjectT o ); void logDrawInfo ( int iLogLevel ); void logCoordInfo ( int iLogLevel ); bool logCircle ( int iLogLevel, VecPosition pos, double dRadius, bool bAll = false ); bool logLine ( int iLogLevel, VecPosition pos1, VecPosition pos2, bool bAll = false ); bool logDrawBallInfo ( int iLogLevel ); void drawCoordinationGraph ( ); // specific static variables char m_colorPlayers[11][8]; /*!< color information with which each player should draw its relevant info*/ int m_iMultX; /*!< This variable denotes with which value the x coordinates of the draw information should be multiplied in order to convert the coordinates to the coordinate system of the monitor*/ int m_iMultY; /*!< This variable denotes with which value the y coordinates of the draw information should be multiplied in order to convert the coordinates to the coordinate system of the monitor*/ bool isFeatureRelevant ( FeatureT type ); Feature getFeature ( FeatureT type ); bool setFeature ( FeatureT type, Feature feature );};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -