📄 score_bms.c.p~
字号:
0 ph neg rlineto pw neg 0 rlineto closepath stroke grestore} bind def% Function water: prints a water mark in background/water { %def gsave scx scy moveto rotate%%IncludeResource: font Times-Bold fTimes-Bold 100 scalefont setfont .97 setgray dup stringwidth pop 2 div neg -50 rmoveto show grestore} bind def% Function rhead: prints the right header/rhead { %def lx ly moveto fHelvetica fnfs 0.8 mul scalefont setfont l-show} bind def% Function footer (cf rf lf -> -)/footer { fHelvetica fnfs 0.8 mul scalefont setfont dx dy moveto show snx sny moveto l-show fnx fny moveto c-show} bind def%%EndResource%%BeginResource: procset a2ps-black+white-Prolog 2.0 1% Function T(ab), jumps to the n-th tabulation in the current line/T { cw mul x0 add y0 moveto} bind def% Function n: move to the next line/n { %def /y0 y0 bfs sub store x0 y0 moveto} bind def% Function N: show and move to the next line/N { Show /y0 y0 bfs sub store x0 y0 moveto} bind def/S { Show} bind def/p { false UL false BX fCourier bfs scalefont setfont Show} bind def/sy { false UL false BX fSymbol bfs scalefont setfont Show} bind def/k { false UL false BX fCourier-Oblique bfs scalefont setfont Show} bind def/K { false UL false BX fCourier-Bold bfs scalefont setfont Show} bind def/c { false UL false BX fCourier-Oblique bfs scalefont setfont Show} bind def/C { false UL false BX fCourier-BoldOblique bfs scalefont setfont Show } bind def/l { false UL false BX fHelvetica bfs scalefont setfont Show} bind def/L { false UL false BX fHelvetica-Bold bfs scalefont setfont Show } bind def/str{ false UL false BX fTimes-Roman bfs scalefont setfont Show} bind def/e{ false UL true BX fHelvetica-Bold bfs scalefont setfont Show} bind def%%EndResource%%EndProlog%%BeginSetup%%IncludeResource: font Courier%%IncludeResource: font Courier-Oblique%%IncludeResource: font Courier-Bold%%IncludeResource: font Times-Roman%%IncludeResource: font Symbol%%IncludeResource: font Courier-BoldOblique%%BeginResource: encoding ISO-8859-1Encoding/ISO-8859-1Encoding [/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /minus /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /bullet /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis ] def%%EndResource% Initialize page description variables./sh 595 def/sw 842 def/llx 24 def/urx 818 def/ury 571 def/lly 24 def/#copies 1 def/th 15.000000 def/fnfs 11 def/bfs 6.760028 def/cw 4.056017 def% Dictionary for ISO-8859-1 support/iso1dict 8 dict begin /fCourier ISO-8859-1Encoding /Courier reencode_font /fCourier-Bold ISO-8859-1Encoding /Courier-Bold reencode_font /fCourier-BoldOblique ISO-8859-1Encoding /Courier-BoldOblique reencode_font /fCourier-Oblique ISO-8859-1Encoding /Courier-Oblique reencode_font /fHelvetica ISO-8859-1Encoding /Helvetica reencode_font /fHelvetica-Bold ISO-8859-1Encoding /Helvetica-Bold reencode_font /fTimes-Bold ISO-8859-1Encoding /Times-Bold reencode_font /fTimes-Roman ISO-8859-1Encoding /Times-Roman reencode_fontcurrentdict end def/bgcolor [ 0 0 0 ] def/bg false def/ul false def/bx false def% The font for line numbering/f# /Helvetica findfont bfs .6 mul scalefont def/fSymbol /Symbol findfont def/hm fnfs 0.25 mul def/pw cw 96.400000 muldef/ph 504.974083 th adddef/pmw urx llx sub pw 2 mul sub 1 div def/pmh 0 def/v 0 def/x [ 0 dup pmw add pw add] def/y [ pmh ph add 0 mul ph add dup] def/scx sw 2 div def/scy sh 2 div def/snx urx def/sny lly 2 add def/dx llx def/dy sny def/fnx scx def/fny dy def/lx snx def/ly ury fnfs 0.8 mul sub def/sx 5 def/tab 8 def/x0 0 def/y0 0 def%%EndSetup%%Page: (1-2) 1%%BeginPageSetup/pagesave save defsh 0 translate 90 rotate%%EndPageSetupiso1dict begingsavellx lly 12 add translate/v 0 store/x0 x v get 2.839212 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(1) # (#include) K( ") p(score_bms.h) str(") p n(2) # () S(#include) K( ") p(ws_info.h) str(") p n(3) # () S(#include) K( ") p(mdp_info.h) str(") p n(4) # () S(#include) K( ") p(oneortwo_step_kick_bms.h) str(") p n(5) # () N(6) # () N(7) # () S(#if) K( 1) p n(8) # () S(#define) K( BASELEVEL 0 ) p(// level for logging; should be 3 for quasi non-logging) c n(9) # (//#define LOG_DAN\(YYY,XXX\) LOG_DEB\(YYY,XXX\)) N(10) # () S(#define) K( LOG_DAN\(YYY,XXX\)) p n(11) # () S(#else) K n(12) # (#define) S( BASELEVEL 3 ) p(// level for logging; should be 3 for quasi non-logging) c n(13) # () S(#define) K( LOG_DAN\(YYY,XXX\)) p n(14) # () S(#endif) K n(15) # () N(16) # () N(17) # () S(bool Score::initialized = false;) p n(18) # () N(19) # (Score::Score\(\) {) N(20) # ( last_time_look_to_goal = -1;) N(21) # ( goalshot_param1 = 0.3;) N(22) # ( goalshot_mode = 0; ) S(//standard goalshot) c n(23) # () S( nr_of_looks_to_goal = -1; ) p n(24) # () N(25) # ( ValueParser vp\(CommandLineOptions::policy_conf,") S(score_bms) str("\);) p n(26) # ( vp.get\(") S(goalshot_param1) str(", goalshot_param1\);) p n(27) # ( vp.get\(") S(goalshot_mode) str(", goalshot_mode\);) p n(28) # () N(29) # ( oneortwo = new OneOrTwoStepKick\(\);) N(30) # (}) N(31) # () N(32) # (Score::~Score\(\) {) N(33) # ( delete oneortwo;) N(34) # (}) N(35) # () N(36) # (bool Score::get_cmd\(Cmd &cmd\) {) N(37) # ( ) S(/*) c n(38) # ( Intention intention;) N(39) # ( Value speed;) N(40) # ( Vector target;) N(41) # () N(42) # ( if \(test_shoot2goal\(intention\)\) {) N(43) # ( speed = intention.kick_speed;) N(44) # ( target = intention.kick_target;) N(45) # ( mdpInfo::set_my_intention\(DECISION_TYPE_SCORE, speed, 0, target.x, target.y,0\);) N(46) # ( LOG_POL\(BASELEVEL,<<"Score get_cmd: try to score w speed "<<speed<<" to target "<<targ) N0 T (et\);) N(47) # ( neurokick->kick_to_pos_with_initial_vel\(speed,target\);) N(48) # ( neurokick->get_cmd\(cmd\);) N(49) # ( return true;) N(50) # ( } else {) N(51) # ( return false;) N(52) # ( }) N(53) # ( */) N(54) # () S(}) p n(55) # () N(56) # (bool Score::test_shoot2goal\(Intention &intention\) {) N(57) # ( ) S(int) k( multi_step;) p n(58) # ( Value velocity, direction;) N(59) # ( Vector target;) N(60) # ( ) S(int) k( best_index;) p n(61) # () N(62) # ( ) S(int) k( result = get_goalshot_chance\(multi_step, velocity, direction, target, best_index\);) p n(63) # () N(64) # ( Value target_dir = \(mdpInfo::opponent_goalpos\(\)-WSinfo::me->pos\).arg\(\);) N(65) # () N(66) # ( risky_goalshot_possible = 0;) N(67) # () N(68) # () N(69) # () N(70) # ( ) S(if) K(\(goalshot_mode == 0\){) p n(71) # ( ) S(if) K( \(result == 4\) result = 1;) p n(72) # ( }) N(73) # ( ) S(else) K({) p n(score_bms.c) (Page 1/15) (Apr 15, 05 17:26) titleborder/v 1 store/x0 x v get 2.839212 add sx cw mul add store/y0 y v get bfs th add sub storex0 y0 moveto(74) # ( ) p(if) K( \(result == 4\)) p n(75) # ( LOG_ERR\(0,") S(Goalshot risky, continue planning) str("\);) p n(76) # ( }) N(77) # ( ) N(78) # ( ) S(if) K( \(result == 0\) {) p n(79) # ( LOG_DAN\(BASELEVEL,") S(no goalshot found) str("\);) p n(80) # ( ) S(//no shot found) c n(81) # () S( ) p(return) K( false;) p n(82) # () N(83) # ( } ) S(else) K( ) p(if) K( \(result == 1\) {) p n(84) # () N(85) # ( ) S(//secure shot) c n(86) # () S( ) p(if) K( \(multi_step\) {) p n(87) # ( LOG_DAN\(0, << ") S(shoot with neuro_kick2! velocity = ) str(" << velocity ) p n(88) # () S 8 T ( << ") S( target.x = ) str(" << target.x << ") p( target.y = ) str(" << target.y\);) p n(89) # ( mdpInfo::set_my_neck_intention\(NECK_INTENTION_LOOKINDIRECTION, target_dir\);) S(//directi) c n0 T (on\);) N(90) # () S( ) p(//set_aaction_score\(aaction, target, velocity\);) c n(91) # () S( intention.set_score\(target, velocity, WSinfo::ws->time\);) p n(92) # ( ) S(return) K( true;) p n(93) # ( ) S(//return Move_Factory::get_1or2_Step_Kick\(velocity, target\);) c n(94) # () S( } ) p(else) K( {) p n(95) # ( LOG_DAN\(0, << ") S(shoot with one step kick! velocity = ) str(" << velocity ) p n(96) # () S 8 T ( << ") S( dir = ) str(" << direction\);) p n(97) # ( intention.set_score\(target, velocity, WSinfo::ws->time\);) N(98) # ( ) S(return) K( true;) p n(99) # ( ) S(// return Move_Factory::get_1Step_Kick\(velocity, direction\);) c n(100) # () S( }) p n(101) # () N(102) # ( } ) S(else) K( ) p(if) K( \(result == 2\) {) p n(103) # () N(104) # ( ) S(//risky because of goalie_age?) c n(105) # () S( ) p(if) K( \(\(mdpInfo::opponent_goalpos\(\) - WSinfo::me->pos\).norm\(\) > 30.0\) {) p n(106) # ( LOG_DAN\(BASELEVEL,") S(result 2 and too far away) str("\);) p n(107) # ( ) S(return) K( false;) p n(108) # ( }) N(109) # () N(110) # () S(#if) K( 0 ) p(// ridi 22.6.03 : replaced by new access to goalie) c n(111) # () S( WSpset alive_opps = WSinfo::alive_opponents;) p n(112) # ( PPlayer goalie = alive_opps.get_player_by_number\(WSinfo::ws->his_goalie_number\);) N(113) # () S(#endif) K n(114) # () S( PPlayer goalie;) p n(115) # ( ) S(if) K(\(WSinfo::his_goalie\)) p n(116) # ( goalie = WSinfo::his_goalie;) N(117) # ( ) S(else) K n(118) # () S( ) p(return) K( false;) p n(119) # ( ) S(//if \(goalie == NULL\) return false;) c n(120) # () S( WSpset pset_tmp = WSinfo::valid_opponents;) p n(121) # ( pset_tmp.keep_players_in_circle\(WSinfo::me->pos, 3.0\);) N(122) # ( ) S(if) K( \(pset_tmp.num > 0\) {) p n
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -