LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
intercept_table.h
Go to the documentation of this file.
1// -*-c++-*-
2
8/*
9 *Copyright:
10
11 Copyright (C) Hidehisa AKIYAMA
12
13 This code is free software; you can redistribute it and/or
14 modify it under the terms of the GNU Lesser General Public
15 License as published by the Free Software Foundation; either
16 version 3 of the License, or (at your option) any later version.
17
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with this library; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
27 *EndCopyright:
28 */
29
31
32#ifndef RCSC_PLAYER_INTERCEPT_TABLE_H
33#define RCSC_PLAYER_INTERCEPT_TABLE_H
34
36#include <rcsc/geom/vector_2d.h>
37#include <rcsc/game_time.h>
38#include <vector>
39#include <map>
40
41namespace rcsc {
42
43class AbstractPlayerObject;
44class PlayerObject;
45class WorldModel;
46
47/*-------------------------------------------------------------------*/
48
54private:
55
57 GameTime M_update_time;
58
60 int M_self_step;
62 int M_self_exhaust_step;
64 int M_teammate_step;
66 int M_second_teammate_step;
68 int M_our_goalie_step;
70 int M_opponent_step;
72 int M_second_opponent_step;
73
75 const PlayerObject * M_first_teammate;
77 const PlayerObject * M_second_teammate;
79 const PlayerObject * M_first_opponent;
81 const PlayerObject * M_second_opponent;
82
84 std::vector< Intercept > M_self_results;
85
87 std::map< const AbstractPlayerObject *, int > M_player_map;
88
89 // not used
90 InterceptTable( const InterceptTable & ) = delete;
91 InterceptTable & operator=( const InterceptTable & ) = delete;
92
93public:
98
102 virtual
104 { }
105
110 void update( const WorldModel & wm );
111
118 void hearTeammate( const WorldModel & wm,
119 const int unum,
120 const int step );
121
128 void hearOpponent( const WorldModel & wm,
129 const int unum,
130 const int step );
131
136 int selfStep() const { return M_self_step; }
137
142 int selfExhaustStep() const { return M_self_exhaust_step; }
143
148 int teammateStep() const { return M_teammate_step; }
149
154 int secondTeammateStep() const { return M_second_teammate_step; }
155
160 int ourGoalieStep() const { return M_our_goalie_step; }
161
166 int opponentStep() const { return M_opponent_step; }
167
172 int secondOpponentStep() const { return M_second_opponent_step; }
173
179 const PlayerObject * firstTeammate() const { return M_first_teammate; }
180
186 const PlayerObject * secondTeammate() const { return M_second_teammate; }
187
193 const PlayerObject * firstOpponent() const { return M_first_opponent; }
194
200 const PlayerObject * secondOpponent() const { return M_second_opponent; }
201
206 const std::vector< Intercept > & selfResults() const
207 {
208 return M_self_results;
209 }
210
215 const std::map< const AbstractPlayerObject *, int > & playerMap() const
216 {
217 return M_player_map;
218 }
219
220private:
224 void clear();
225
230 void predictSelf( const WorldModel & wm );
231
236 void predictTeammate( const WorldModel & wm );
237
242 void predictOpponent( const WorldModel & wm );
243};
244
245}
246
247#endif
game time object
Definition: game_time.h:43
interception info holder for all players
Definition: intercept_table.h:53
InterceptTable()
init member variables, reserve cache vector memory
virtual ~InterceptTable()
destructor. nothing to do
Definition: intercept_table.h:103
void hearTeammate(const WorldModel &wm, const int unum, const int step)
update teammate intercept information by heard information
int secondOpponentStep() const
get the ball access step for the second opponent
Definition: intercept_table.h:172
const PlayerObject * secondTeammate() const
get the teammate object second fastest to the ball
Definition: intercept_table.h:186
const PlayerObject * firstOpponent() const
get the oppnent object fastest to the ball
Definition: intercept_table.h:193
int ourGoalieStep() const
get the ball access step for the teammate goalie
Definition: intercept_table.h:160
void hearOpponent(const WorldModel &wm, const int unum, const int step)
update opponent intercept information by heard information
const PlayerObject * secondOpponent() const
get the oppnent object second fastest to the ball
Definition: intercept_table.h:200
int selfExhaustStep() const
get minimal ball gettable step for self with stamina exhaust
Definition: intercept_table.h:142
const std::map< const AbstractPlayerObject *, int > & playerMap() const
get all players' intercept step container.
Definition: intercept_table.h:215
void update(const WorldModel &wm)
update table information
int opponentStep() const
get minimal ball gettable step for opponent
Definition: intercept_table.h:166
const std::vector< Intercept > & selfResults() const
get self interception cache container
Definition: intercept_table.h:206
int secondTeammateStep() const
get the ball access step for the second teammate
Definition: intercept_table.h:154
int selfStep() const
get minimal ball gettable step for self without stamina exhaust
Definition: intercept_table.h:136
int teammateStep() const
get minimal ball gettable step for teammate
Definition: intercept_table.h:148
const PlayerObject * firstTeammate() const
get the teammate object fastest to the ball
Definition: intercept_table.h:179
observed player object class
Definition: player_object.h:54
player's internal field status
Definition: world_model.h:67
game time depending on RCSSServer2D Header File
intercept action type Header File
2d vector class Header File.