📄 score_bms.c.ps
字号:
(124) # ( ) S(if) K( \(multi_step\) {) p n(125) # () S 8 T (LOG_DAN\(0, << ") S(shoot with neuro_kick2! velocity = ) str(" << velocity ) p n(126) # () S 8 T () S 16 T (<< ") S( target.x = ) str(" << target.x << ") p( target.y = ) str(" << target.y\);) p n(127) # () S 8 T (mdpInfo::set_my_intention\(DECISION_TYPE_SCORE, velocity, direction,) N(128) # () S 8 T () S 16 T () S 24 T () S 32 T ( target.x, target.y, best_index\);) N(129) # () S 8 T (mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, target_dir\);) S(//) c n0 T (direction\);) N(130) # () S() p 8 T (intention.set_score\(target, velocity, WSinfo::ws->time\);) N(131) # () S 8 T () S(//set_aaction_score\(aaction, target, velocity\);) c n(132) # () S() p 8 T () S(return) K( true;) p n(133) # () S 8 T () S(//return Move_Factory::get_Neuro_Kick2\(5, velocity, target.x, target.y\);) c n(134) # () S( } ) p(else) K( {) p n(135) # () S 8 T (LOG_DAN\(0, << ") S(shoot with one step kick! velocity = ) str(" << velocity ) p n(136) # () S 8 T () S 16 T (<< ") S( dir = ) str(" << direction\);) p n(score_bms.c) (Page 2/16) (Apr 15, 05 17:26) titlebordergrestore(Printed by Thomas Gabel) rhead(score_bms.c) (1/8) (Monday July 04, 2005) footerend % of iso1dictpagesave restoreshowpage%%Page: (3-4) 2%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 2.994530 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(137) # () p 8 T () S(//) c 16 T (return Move_Factory::get_1Step_Kick\(velocity, direction\);) N(138) # () S() p 8 T (intention.set_score\(target, velocity, WSinfo::ws->time\);) N(139) # () S 8 T () S(//set_aaction_score\(aaction, target, velocity\);) c n(140) # () S() p 8 T () S(return) K( true;) p n(141) # ( }) N(142) # () N(143) # ( } ) S(else) K( {) p n(144) # () N(145) # ( ) S(if) K( \(goalie->age <= 4\) {) p n(146) # () S 8 T (LOG_DAN\(0, << ") S(opponent goalie too young, don't look to him) str("\);) p n(147) # () S 8 T () S(return) K( false;) p n(148) # ( }) N(149) # () N(150) # ( LOG_DAN\(0, << ") S(opponent goalie too old, look to goal with hold ball) str("\);) p n(151) # ( ) S(//Value target_dir = \(mdpInfo::opponent_goalpos\(\)-WSinfo::me->pos\).arg\(\);) c n(152) # () S( ) p n(153) # ( ) S(if) K( \(last_time_look_to_goal != WSinfo::ws->time - 1\) {) p n(154) # () S 8 T (nr_of_looks_to_goal = 1;) N(155) # ( } ) S(else) K( {) p n(156) # () S 8 T (++nr_of_looks_to_goal;) N(157) # ( }) N(158) # ( last_time_look_to_goal = WSinfo::ws->time;) N(159) # () N(160) # ( ) S(/*) c n(161) # ( if \(nr_of_looks_to_goal == 1\) {) N(162) # () S 8 T (LOG_DAN\(0, << "look to center of goal"\);) N(163) # () S 8 T (target_dir = \(mdpInfo::opponent_goalpos\(\)-WSinfo::me->pos\).arg\(\);) N(164) # ( }) N(165) # ( else if \(nr_of_looks_to_goal == 2\) {) N(166) # () S 8 T (LOG_DAN\(0, << "look to left goalcorner"\);) N(167) # () S 8 T (target_dir = \(ServerOptions::their_left_goal_corner-WSinfo::me->pos\).arg\(\);) N(168) # ( }) N(169) # ( else if \(nr_of_looks_to_goal == 3\) {) N(170) # () S 8 T (LOG_DAN\(0, << "look to right goalcorner"\);) N(171) # () S 8 T (target_dir = \(ServerOptions::their_right_goal_corner-WSinfo::me->pos\).arg\(\);) N(172) # ( }) N(173) # ( else if \(nr_of_looks_to_goal == 4\) {*/) N(174) # () S( ) p(if) K( \(nr_of_looks_to_goal >= 3\) {) p n(175) # () S 8 T () S(if) K( \(multi_step\) {) p n(176) # () S 8 T ( LOG_DAN\(0, << ") S(I looked to goal, didn't see goalie and I'm close to goal, shoot) str("\);) p n(177) # () S 8 T ( LOG_DAN\(0, << ") S(shoot with neuro_kick2! velocity = ) str(" << velocity ) p n(178) # () S 8 T () S 16 T ( << ") S( target.x = ) str(" << target.x << ") p( target.y = ) str(" << target.y\);) p n(179) # () S 8 T ( mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, direction\);) N(180) # () S 8 T ( mdpInfo::set_my_intention\(DECISION_TYPE_SCORE, velocity, direction,) N(181) # () S 8 T () S 16 T () S 24 T () S 32 T ( target.x, target.y, best_index\);) N(182) # () S 8 T ( intention.set_score\(target, velocity, WSinfo::ws->time\);) N(183) # () S 8 T ( ) S(//set_aaction_score\(aaction, target, velocity\);) c n(184) # () S() p 8 T ( ) S(return) K( true;) p n(185) # () N(186) # () S 8 T (} ) S(else) K( {) p n(187) # () S 8 T ( LOG_DAN\(0, << ") S(shoot with one step kick! velocity = ) str(" << velocity ) p n(188) # () S 8 T () S 16 T ( << ") S( dir = ) str(" << direction\);) p n(189) # () S 8 T ( ) S(//return Move_Factory::get_1Step_Kick\(velocity, direction\);) c n(190) # () S() p 8 T ( intention.set_score\(target, velocity, WSinfo::ws->time\);) N(191) # () S 8 T ( ) S(//set_aaction_score\(aaction, target, velocity\);) c n(192) # () S() p 8 T ( ) S(return) K( true;) p n(193) # () S 8 T (}) N(194) # ( }) N(195) # () S 8 T () N(196) # ( mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, target_dir\);) N(197) # ( ) S(if) K(\(mdpInfo::could_see_in_direction\(target_dir\) == true\) {) p n(198) # () S 8 T () S(// I can see in direction by turning neck without turning body) c n(199) # () S() p 8 T (mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, target_dir\);) N(200) # () S 8 T (mdpInfo::set_my_intention\(DECISION_TYPE_LOOKFORGOALIE, mdpInfo::opponent_goal) N0 T (pos\(\).x, ) N(201) # () S 8 T () S 16 T () S 24 T () S 32 T ( mdpInfo::opponent_goalpos\(\).y\);) N(202) # () S 8 T () S(// ridi03:todo) c n(203) # () S() p 8 T () S(//) c 16 T (return Move_Factory::get_Hold_Ball\(1\);) S 56 T () N(204) # () S() p 8 T () N(205) # () S 8 T () S(//LOG_ERR\(0,"WBALL03: should hold ball and look; not yet implemented"\);) c n(score_bms.c) (Page 3/16) (Apr 15, 05 17:26) titleborder/v 1 store/x0 x v get 2.994530 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(206) # () p 8 T () S(//LOG_DAN\(BASELEVEL,"WBALL03: should hold ball and look; not yet implemented") c n0 T (\);) N(207) # () S() p 8 T (intention.set_holdturn\(ANGLE\(target_dir\), WSinfo::ws->time\);) N(208) # () S 8 T () S(return) K( true;) p n(209) # ( } ) S(else) K( {) p n(210) # () S 8 T () S(// have to turn body.) c n(211) # () S() p 8 T (LOG_DAN\(0, ") S( have to turn body, but don't do it) str("\);) p n(212) # () S 8 T (last_time_look_to_goal = -1;) N(213) # () S 8 T () S(return) K( false;) p n(214) # () S 8 T () S(/*) c n(215) # () S 8 T ( mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, target_dir\);) N0 T ( ) N(216) # () S 8 T ( return Move_Factory::get_Hold_Ball\(target_dir,1\); ) N(217) # () S 8 T (*/) N(218) # () S( }) p n(219) # ( }) N(220) # () N(221) # ( } ) S(else) K( ) p(if) K( \(result == 3\) {) p n(222) # ( ) S(//risky because opponent could intercept) c n(223) # () N(224) # () S( } ) p(else) K( ) p(if) K( \(result == 4\) {) p n(225) # ( ) S(//risky because goal could be missed) c n(226) # () N(227) # () S( saved_velocity = velocity;) p n(228) # ( saved_direction = direction;) N(229) # ( saved_target = target;) N(230) # ( saved_multi_step = multi_step;) N(231) # ( risky_goalshot_possible = 1;) N(232) # () N(233) # ( } ) S(else) K( ) p(if) K( \(\(result == 5\) || \(result == 6\)\) {) p n(234) # ( ) S(//opponent goalie not alive or goalie number not known or other strange problem) c n(235) # () N(236) # () S( ) p(if) K( \(\(mdpInfo::opponent_goalpos\(\) - WSinfo::me->pos\).norm\(\) > 25.0\) {) p n(237) # ( LOG_DAN\(0, ") S( result 5 and too far) str("\);) p n(238) # ( ) S(return) K( false;) p n(239) # ( }) N(240) # () N(241) # ( LOG_DAN\(0, << ") S(opponent goalie not alive, number not known or other strange problem, look to goal with hold ball) str() p n0 T ("\);) N(242) # ( Value target_dir = \(mdpInfo::opponent_goalpos\(\)-WSinfo::me->pos\).arg\(\);) N(243) # ( ) N(244) # ( ) S(if) K( \(last_time_look_to_goal != WSinfo::ws->time - 1\) {) p n(245) # ( nr_of_looks_to_goal = 1;) N(246) # ( } ) S(else) K( {) p n(247) # ( ++nr_of_looks_to_goal;) N(248) # ( }) N(249) # ( last_time_look_to_goal = WSinfo::ws->time;) N(250) # () N(251) # ( target_dir = \(mdpInfo::opponent_goalpos\(\)-WSinfo::me->pos\).arg\(\);) N(252) # ( ) S(/*) c n(253) # ( if \(nr_of_looks_to_goal == 1\) target_dir = \(mdpInfo::opponent_goalpos\(\)-WSinfo::m) N0 T (e->pos\).arg\(\);) N(254) # ( else if \(nr_of_looks_to_goal == 2\) target_dir = \(ServerOptions::their_left_goal_c) N0 T (orner-WSinfo::me->pos\).arg\(\);) N(255) # ( else if \(nr_of_looks_to_goal == 3\) target_dir = \(ServerOptions::their_right_goal_) N0 T (corner-WSinfo::me->pos\).arg\(\);) N(256) # ( else if \(nr_of_looks_to_goal == 4\) {*/) N(257) # () S( ) p(if) K( \(nr_of_looks_to_goal >= 3\) {) p n(258) # ( ) S(if) K( \(result == 6\) {) p n(259) # () S 8 T (Vector goal = Vector\(ServerOptions::pitch_length/2.0, 0.0\);) N(260) # () S 8 T (ANGLE angle = \(goal-WSinfo::ball->pos\).ARG\(\);) N(261) # () S 8 T (Value one_step_vel, multi_step_vel;) N(262) # () S 8 T () S(//Move_1or2_Step_Kick::get_vel_in_dir\(3.0, angle, one_step_vel, multi_step_ve) c n0 T (l\);) N(263) # () S() p 8 T (oneortwo->kick_in_dir_with_max_vel\(ANGLE\(angle\)\);) N(264) # () S 8 T (oneortwo->get_vel\(one_step_vel, multi_step_vel\);) N(265) # () N(266) # () S 8 T () S(if) K( \(one_step_vel > ServerOptions::ball_speed_max\)) p n(267) # () S 8 T ( one_step_vel = ServerOptions::ball_speed_max;) N(268) # () N(score_bms.c) (Page 4/16) (Apr 15, 05 17:26) titlebordergrestore(Printed by Thomas Gabel) rhead(score_bms.c) (2/8) (Monday July 04, 2005) footerend % of iso1dictpagesave restoreshowpage%%Page: (5-6) 3%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 2.994530 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(269) # () p 8 T () S(if) K( \(multi_step_vel > ServerOptions::ball_speed_max\)) p n(270) # () S 8 T ( multi_step_vel = ServerOptions::ball_speed_max;) N(271) # () N(272) # () S 8 T (LOG_DAN\(0, << ") S(I looked to goal, didn't see goalie AND opponents and I'm close to goal, shoot) str("\);) p n(273) # () S 8 T (LOG_DAN\(0, << ") S(shoot with neuro_kick2! velocity = ) str(" << multi_step_vel ) p n(274) # () S 8 T () S 16 T (<< ") S( target.x = ) str(" << goal.x << ") p( target.y = ) str(" << goal.y\);) p n(275) # () S 8 T (mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, ) N(276) # () S 8 T () S 16 T () S 24 T () S 32 T ( \(goal-WSinfo::me->pos\).arg\(\)\);) N(277) # () S 8 T () S(//return Move_Factory::get_Neuro_Kick2\(5, velocity, target.x, target.y\);) c n(278) # () S() p 8 T (intention.set_score\(goal, multi_step_vel, WSinfo::ws->time\);) N(279) # () S 8 T () S(//set_aaction_score\(aaction, target, velocity\);) c n(280) # () S() p 8 T () S(return) K( true;) p 24 T () N(281) # ( }) N(282) # ( ) S(if) K( \(multi_step\) {) p n(283) # () S 8 T (LOG_DAN\(0, << ") S(I looked to goal, didn't see goalie and I'm close to goal, shoot) str("\);) p n(284) # () S 8 T (LOG_DAN\(0, << ") S(shoot with neuro_kick2! velocity = ) str(" << velocity ) p n(285) # () S 8 T () S 16 T (<< ") S( target.x = ) str(" << target.x << ") p( target.y = ) str(" << target.y\);) p n(286) # () S 8 T (mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, ) N(287) # () S 8 T () S 16 T () S 24 T () S 32 T ( \(target-WSinfo::me->pos\).arg\(\)\);) N(288) # () S 8 T () S(//return Move_Factory::get_Neuro_Kick2\(5, velocity, target.x, target.y\);) c n(289) # () S() p 8 T (intention.set_score\(target, velocity, WSinfo::ws->time\);) N(290) # () S 8 T () S(//set_aaction_score\(aaction, target, velocity\);) c n(291) # () S() p 8 T () S(return) K( true;) p n(292) # () N(293) # () S 8 T () S(//return Move_Factory::get_1or2_Step_Kick\(velocity, target\);) c n(294) # () S( } ) p(else) K( {) p n(295) # () S 8 T (LOG_DAN\(0, << ") S(shoot with one step kick! velocity = ) str(" << velocity ) p n(296) # () S 8 T () S 16 T (<< ") S( dir = ) str(" << direction\);) p n(297) # () S 8 T (intention.set_score\(target, velocity, WSinfo::ws->time\);) N(298) # () S 8 T () S(//set_aaction_score\(aaction, target, velocity\);) c n(299) # () S() p 8 T () S(return) K( true;) p n(300) # () S 8 T () S(//return Move_Factory::get_1Step_Kick\(velocity, direction\);) c n(301) # () S( }) p n(302) # ( }) N(303) # ( ) N(304) # ( mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, target_dir\);) N(305) # ( ) S(if) K(\(mdpInfo::could_see_in_direction\(target_dir\) == true\) {) p n(306) # ( ) S(// I can see in direction by turning neck without turning body) c n(307) # () S( mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, target_dir\);) p n(308) # ( mdpInfo::set_my_intention\(DECISION_TYPE_LOOKFORGOALIE, mdpInfo::opponent_goalpo) N0 T (s\(\).x, ) N(309) # () S 8 T () S 16 T () S 24 T () S 32 T (mdpInfo::opponent_goalpos\(\).y\);) N(310) # () N(311) # ( ) S(// ridi03:todo) c n(312) # () S( ) p(//) c 16 T (return Move_Factory::get_Hold_Ball\(1\);) S 56 T () N(313) # () S( LOG_ERR\(0,") p(WBALL03: should hold ball and look; not yet implemented) str("\);) p n(314) # ( LOG_DAN\(0,") S(WBALL03: should hold ball and look; not yet implemented) str("\);) p n(315) # ( intention.set_holdturn\(ANGLE\(target_dir\), WSinfo::ws->time\);) N(316) # ( ) S(return) K( true;) p n(317) # ( } ) S(else) K( {) p n(318) # ( ) S(// have to turn body.) c n(319) # () S( LOG_DAN\(0, ") p( have to turn body, but don't do it) str("\);) p n(320) # ( last_time_look_to_goal = -1;) N(321) # ( ) S(return) K( false;) p n(322) # ( }) N(323) # ( } ) N(324) # ( LOG_DAN\(0, ") S( shoot 2 goal - unsuccessful result ) str("<<result\); ) p n(325) # ( ) S(return) K( false;) p n(326) # (}) N(327) # () N(328) # () N(329) # () S(int) k( Score::get_goalshot_chance\() p(int) k( &multi_step, Value &velocity, ) p n(330) # () S 8 T () S 16 T () S 24 T () S 32 T () S 40 T ( Value &direction, Vector &target, ) S(int) k( ) p n0 T (&best_index\) {) N(331) # () N(332) # ( ) S(if) K( \(WSinfo::me->pos.x < 15.0\) ) p(return) K( 0;) p n(333) # () N(334) # ( ) S(if) K( \( \(Tools::my_abs_angle_to\(Vector\(FIELD_BORDER_X, 0.0\)\).get_value\(\) > DEG2RAD\(83\)) p n0 T (\) &&) N(335) # ( \(Tools::my_abs_angle_to\(Vector\(FIELD_BORDER_X, 0.0\)\).get_value\(\) < DEG2RAD\(277) N(score_bms.c) (Page 5/16) (Apr 15, 05 17:26) titleborder/v 1 store/x0 x v get 2.994530 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto0 T (\)\) &&) p n(336) # ( fabs\(WSinfo::me->pos.y\) > 8.0\) {) N(337) # ( ) S(//LOG_DEB\(0, << "don't shoot, wrong angle"\);) c n(338) # () S( ) p(return) K( 0;) p n(339) # ( }) N(340) # ( ) N(341) # ( Vector test_targets[9];) N(342) # ( Value test_dirs[9];) N
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -