5757#include < rcsc/common/server_param.h>
5858#include < rcsc/common/logger.h>
5959
60- // #define DEBUG_PLANNED_ACTION
6160using namespace rcsc ;
6261
6362namespace {
@@ -203,21 +202,6 @@ Bhv_PlannedAction::Bhv_PlannedAction()
203202 */
204203bool
205204Bhv_PlannedAction::execute ( PlayerAgent * agent )
206- {
207- dlog.addText ( Logger::TEAM,
208- __FILE__" : Bhv_PlannedAction" );
209-
210- const CooperativeAction & first_action = M_chain_graph.getFirstAction ();
211-
212- #ifdef DEBUG_PLANNED_ACTION
213- std::cout<<" planner execute" <<" i" <<first_action.uniqueIndex ()<< " c" <<first_action.category ()<<" t" <<first_action.targetPlayerUnum ()<<" p" <<first_action.parentIndex ()<<std::endl;
214- #endif
215-
216- return execute ( agent, first_action.uniqueIndex () );
217- }
218-
219- bool
220- Bhv_PlannedAction::execute ( PlayerAgent * agent, int unique_index )
221205{
222206 dlog.addText ( Logger::TEAM,
223207 __FILE__" : Bhv_PlannedAction" );
@@ -230,30 +214,9 @@ Bhv_PlannedAction::execute( PlayerAgent * agent, int unique_index )
230214 const ServerParam & SP = ServerParam::i ();
231215 const WorldModel & wm = agent->world ();
232216
233- if ( M_chain_graph.getAllResults ().find ( unique_index ) == M_chain_graph.getAllResults ().end () )
234- {
235- #ifdef DEBUG_PLANNED_ACTION
236- std::cout<<" Bhv_PlannedAction: invalid index" <<std::endl;
237- #endif
238- dlog.addText ( Logger::TEAM,
239- __FILE__" (Bhv_PlannedAction) invalid index" );
240- return false ;
241- }
242-
243- const CooperativeAction & first_action = M_chain_graph.getAllResults ().at ( unique_index ).first ->action ();
244- #ifdef DEBUG_PLANNED_ACTION
245- std::cout<<" planner execute" <<" i" <<first_action.uniqueIndex ()<< " c" <<first_action.category ()<<" t" <<first_action.targetPlayerUnum ()<<" p" <<first_action.parentIndex ()<<std::endl;
246- #endif
217+ const CooperativeAction & first_action = M_chain_graph.getFirstAction ();
247218
248- if ( first_action.parentIndex () != -1 )
249- {
250- #ifdef DEBUG_PLANNED_ACTION
251- std::cout<<" Bhv_PlannedAction: not root action" <<std::endl;
252- #endif
253- dlog.addText ( Logger::TEAM,
254- __FILE__" (Bhv_PlannedAction) not root action" );
255- return false ;
256- }
219+ // std::cout<<"first action:"<<first_action.category()<<" index:"<<first_action.uniqueIndex()<<std::endl;
257220
258221 // ActionChainGraph::debug_send_chain( agent, M_chain_graph.getAllChain() );
259222
0 commit comments