⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 images.tex

📁 robocup3d littlegreenbats_howtorobocop-0.1.tar.gz
💻 TEX
字号:
\batchmode\documentclass[openany]{book}\RequirePackage{ifthen}\usepackage[british]{babel}\usepackage[dvips]{graphicx}\usepackage{float}\floatstyle{boxed}\newfloat{program}{H}{lop}%\renewcommand{\textfraction}{0.05}%\renewcommand{\topfraction}{0.95}%\renewcommand{\bottomfraction}{0.95}%\renewcommand{\floatpagefraction}{0.35}\setcounter{totalnumber}{5}\author{Little Green BATS}\title{RoboCup 3D Simulation HowTo}\usepackage[dvips]{color}\pagecolor[gray]{.7}\usepackage[]{inputenc}\makeatletter\makeatletter\count@=\the\catcode`\_ \catcode`\_=8 \newenvironment{tex2html_wrap}{}{}%\catcode`\<=12\catcode`\_=\count@\newcommand{\providedcommand}[1]{\expandafter\providecommand\csname #1\endcsname}%\newcommand{\renewedcommand}[1]{\expandafter\providecommand\csname #1\endcsname{}%  \expandafter\renewcommand\csname #1\endcsname}%\newcommand{\newedenvironment}[1]{\newenvironment{#1}{}{}\renewenvironment{#1}}%\let\newedcommand\renewedcommand\let\renewedenvironment\newedenvironment\makeatother\let\mathon=$\let\mathoff=$\ifx\AtBeginDocument\undefined \newcommand{\AtBeginDocument}[1]{}\fi\newbox\sizebox\setlength{\hoffset}{0pt}\setlength{\voffset}{0pt}\addtolength{\textheight}{\footskip}\setlength{\footskip}{0pt}\addtolength{\textheight}{\topmargin}\setlength{\topmargin}{0pt}\addtolength{\textheight}{\headheight}\setlength{\headheight}{0pt}\addtolength{\textheight}{\headsep}\setlength{\headsep}{0pt}\setlength{\textwidth}{349pt}\newwrite\lthtmlwrite\makeatletter\let\realnormalsize=\normalsize\global\topskip=2sp\def\preveqno{}\let\real@float=\@float \let\realend@float=\end@float\def\@float{\let\@savefreelist\@freelist\real@float}\def\liih@math{\ifmmode$\else\bad@math\fi}\def\end@float{\realend@float\global\let\@freelist\@savefreelist}\let\real@dbflt=\@dbflt \let\end@dblfloat=\end@float\let\@largefloatcheck=\relax\let\if@boxedmulticols=\iftrue\def\@dbflt{\let\@savefreelist\@freelist\real@dbflt}\def\adjustnormalsize{\def\normalsize{\mathsurround=0pt \realnormalsize \parindent=0pt\abovedisplayskip=0pt\belowdisplayskip=0pt}% \def\phantompar{\csname par\endcsname}\normalsize}%\def\lthtmltypeout#1{{\let\protect\string \immediate\write\lthtmlwrite{#1}}}%\newcommand\lthtmlhboxmathA{\adjustnormalsize\setbox\sizebox=\hbox\bgroup\kern.05em }%\newcommand\lthtmlhboxmathB{\adjustnormalsize\setbox\sizebox=\hbox to\hsize\bgroup\hfill }%\newcommand\lthtmlvboxmathA{\adjustnormalsize\setbox\sizebox=\vbox\bgroup % \let\ifinner=\iffalse \let\)\liih@math }%\newcommand\lthtmlboxmathZ{\@next\next\@currlist{}{\def\next{\voidb@x}}% \expandafter\box\next\egroup}%\newcommand\lthtmlmathtype[1]{\gdef\lthtmlmathenv{#1}}%\newcommand\lthtmllogmath{\dimen0\ht\sizebox \advance\dimen0\dp\sizebox  \ifdim\dimen0>.95\vsize   \lthtmltypeout{%*** image for \lthtmlmathenv\space is too tall at \the\dimen0, reducing to .95 vsize ***}%   \ht\sizebox.95\vsize \dp\sizebox\z@ \fi  \lthtmltypeout{l2hSize %:\lthtmlmathenv:\the\ht\sizebox::\the\dp\sizebox::\the\wd\sizebox.\preveqno}}%\newcommand\lthtmlfigureA[1]{\let\@savefreelist\@freelist       \lthtmlmathtype{#1}\lthtmlvboxmathA}%\newcommand\lthtmlpictureA{\bgroup\catcode`\_=8 \lthtmlpictureB}%\newcommand\lthtmlpictureB[1]{\lthtmlmathtype{#1}\egroup       \let\@savefreelist\@freelist \lthtmlhboxmathB}%\newcommand\lthtmlpictureZ[1]{\hfill\lthtmlfigureZ}%\newcommand\lthtmlfigureZ{\lthtmlboxmathZ\lthtmllogmath\copy\sizebox       \global\let\@freelist\@savefreelist}%\newcommand\lthtmldisplayA{\bgroup\catcode`\_=8 \lthtmldisplayAi}%\newcommand\lthtmldisplayAi[1]{\lthtmlmathtype{#1}\egroup\lthtmlvboxmathA}%\newcommand\lthtmldisplayB[1]{\edef\preveqno{(\theequation)}%  \lthtmldisplayA{#1}\let\@eqnnum\relax}%\newcommand\lthtmldisplayZ{\lthtmlboxmathZ\lthtmllogmath\lthtmlsetmath}%\newcommand\lthtmlinlinemathA{\bgroup\catcode`\_=8 \lthtmlinlinemathB}\newcommand\lthtmlinlinemathB[1]{\lthtmlmathtype{#1}\egroup\lthtmlhboxmathA  \vrule height1.5ex width0pt }%\newcommand\lthtmlinlineA{\bgroup\catcode`\_=8 \lthtmlinlineB}%\newcommand\lthtmlinlineB[1]{\lthtmlmathtype{#1}\egroup\lthtmlhboxmathA}%\newcommand\lthtmlinlineZ{\egroup\expandafter\ifdim\dp\sizebox>0pt %  \expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetinline}\newcommand\lthtmlinlinemathZ{\egroup\expandafter\ifdim\dp\sizebox>0pt %  \expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetmath}\newcommand\lthtmlindisplaymathZ{\egroup %  \centerinlinemath\lthtmllogmath\lthtmlsetmath}\def\lthtmlsetinline{\hbox{\vrule width.1em \vtop{\vbox{%  \kern.1em\copy\sizebox}\ifdim\dp\sizebox>0pt\kern.1em\else\kern.3pt\fi  \ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}}\def\lthtmlsetmath{\hbox{\vrule width.1em\kern-.05em\vtop{\vbox{%  \kern.1em\kern0.8 pt\hbox{\hglue.17em\copy\sizebox\hglue0.8 pt}}\kern.3pt%  \ifdim\dp\sizebox>0pt\kern.1em\fi \kern0.8 pt%  \ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}}\def\centerinlinemath{%  \dimen1=\ifdim\ht\sizebox<\dp\sizebox \dp\sizebox\else\ht\sizebox\fi  \advance\dimen1by.5pt \vrule width0pt height\dimen1 depth\dimen1  \dp\sizebox=\dimen1\ht\sizebox=\dimen1\relax}\def\lthtmlcheckvsize{\ifdim\ht\sizebox<\vsize   \ifdim\wd\sizebox<\hsize\expandafter\hfill\fi \expandafter\vfill  \else\expandafter\vss\fi}%\providecommand{\selectlanguage}[1]{}%\makeatletter \tracingstats = 1 \begin{document}\pagestyle{empty}\thispagestyle{empty}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength hsize=\the\hsize}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength vsize=\the\vsize}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength hoffset=\the\hoffset}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength voffset=\the\voffset}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength topmargin=\the\topmargin}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength topskip=\the\topskip}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength headheight=\the\headheight}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength headsep=\the\headsep}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength parskip=\the\parskip}\lthtmltypeout{}%\lthtmltypeout{latex2htmlLength oddsidemargin=\the\oddsidemargin}\lthtmltypeout{}%\makeatletter\if@twoside\lthtmltypeout{latex2htmlLength evensidemargin=\the\evensidemargin}%\else\lthtmltypeout{latex2htmlLength evensidemargin=\the\oddsidemargin}\fi%\lthtmltypeout{}%\makeatother\setcounter{page}{1}\onecolumn% !!! IMAGES START HERE !!!\setcounter{totalnumber}{5}\stepcounter{chapter}\stepcounter{chapter}\stepcounter{section}\stepcounter{section}\stepcounter{chapter}\stepcounter{section}\stepcounter{section}\stepcounter{chapter}\stepcounter{chapter}\stepcounter{section}{\newpage\clearpage\lthtmlfigureA{program182}%\begin{program}\begin{verbatim}SocketComm comm("localhost", 3100);comm.connect();\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program186}%\begin{program}\begin{verbatim}comm.update();\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program191}%\begin{program}\begin{verbatim}rf<Predicate> myPredicate = makeMyPredicate();comm.send(myPredicate);\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program195}%\begin{program}\begin{verbatim}while (comm.hasNextMessage())  rf<Predicate> message = comm.nextMessage();\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program199}%\begin{program}\begin{verbatim}// Create the SocketComm and connectSocketComm comm("localhost", 3100);comm.connect();// Wait for the first message from the servercomm.update();// Identify yourself to the servercomm.init(0, "MyTeam");// Main loopwhile (true){  comm.update();  while (comm.hasNextMessage())    handleMessage(comm.nextMessage());}\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}\stepcounter{section}{\newpage\clearpage\lthtmlfigureA{program205}%\begin{program}\begin{verbatim}WorldModel::initialize(comm);WorldModel& wm = WorldModel::getInstance();\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program212}%\begin{program}\begin{verbatim}wm.update();\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}\stepcounter{section}{\newpage\clearpage\lthtmlfigureA{program226}%\begin{program}\begin{verbatim}Cerebellum& cer = Cerebellum::getInstance();rf<MoveJointAction> action =  new MoveJointAction(Types::LLEG1, 0.1);cer.addAction(action);cer.outputCommands(comm);\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}\stepcounter{section}{\newpage\clearpage\lthtmlfigureA{program233}%\begin{program}\begin{verbatim}class MyAgent : public bats::HumanoidAgent{  public:    MyAgent(std::string teamName)    : bats::HumanoidAgent(teamName)    {}};\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program239}%\begin{program}\begin{verbatim}int main(){  MyAgent agent("MyTeam");  agent.run();}\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}\stepcounter{section}\stepcounter{subsection}{\newpage\clearpage\lthtmlfigureA{program257}%\begin{program}\begin{verbatim}class MyBehavior : public Behavior{  virtual rf<Goal> generateGoal(unsigned step,                                unsigned slot);  virtual rf<State> getCurrentState();  virtual ConfidenceInterval getCapability(rf<State> s,                                           rf<Goal> g);public:  MyBehavior(std::string const &id,             std::string const &playerClass);};\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program262}%\begin{program}\begin{verbatim}$ cd util/$ ./createbehavior.pl[Enter the behaviors name (e.g. MyBehavior)]\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}\stepcounter{subsubsection}{\newpage\clearpage\lthtmlfigureA{program268}%\begin{program}\begin{verbatim}// Define the root, which is always a sequence:d_tree = new AST::Node(sequenceType);// Add one step to the sequence:d_tree->addChild(new AST::Node(andType));// Add one slot to the first step:d_tree->getChild(0)->addChild(new AST::Node(orType));\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program274}%\begin{program}\begin{verbatim}// Define the root, which is always a sequence:d_tree = new AST::Node(sequenceType);// Add first step to the sequence:d_tree->addChild(new AST::Node(andType));// Add one slot to the first step:d_tree->getChild(0)->addChild(new AST::Node(orType));// Add second step to the sequence:d_tree->addChild(new AST::Node(andType));// Add two slots to the second step:d_tree->getChild(1)->addChild(new AST::Node(orType));d_tree->getChild(1)->addChild(new AST::Node(orType));// Add third step to the sequence:d_tree->addChild(new AST::Node(andType));// Add one slot to the third step:d_tree->getChild(2)->addChild(new AST::Node(orType));\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmldisplayA{displaymath280}%\begin{displaymath}(0 \leq BallDist < 5) \wedge (10 \leq OpponentDist < 15)\end{displaymath}%\lthtmldisplayZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program286}%\begin{program}\begin{verbatim}rf<State> state = new State();rf<OrNode> dis = state->addDisjunct();rf<AndNode> con = dis->addConjunct();con->addVar("BallDist", 0, 5);con->addVar("OpponentDist", 10, 15);\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program295}%\begin{program}\begin{verbatim}void MyBehavior::update(){  Behavior::update();    // Check if we are already committed  // due to committed subbehavior(s)  if (d_committed)    return;    // Commit if we can still reach our goal    if (goalStillReachable())    d_committed = true;  else    d_committed = false;\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}\stepcounter{subsection}{\newpage\clearpage\lthtmlfigureA{program314}%\begin{program}\begin{verbatim}<?xml version="1.0" encoding="ISO-8859-1"?><conf xmlns:xi="http://www.w3.org/2003/XInclude">\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program319}%\begin{program}\begin{verbatim}<player id="1" class="attacker" />\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program324}%\begin{program}\begin{verbatim}<player-class id="attacker">\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program330}%\begin{program}\begin{verbatim}<behavior type="MyBehavior" id="mybehavior">\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program336}%\begin{program}\begin{verbatim}  <param>        <deg>10</deg>        <joint slot="0"></joint>        <joint slot="1"></joint>  </param>\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program344}%\begin{program}\begin{verbatim}<slot index="0-0">  <behavior refid="mybehavior" /></slot>\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}\stepcounter{subsection}{\newpage\clearpage\lthtmlfigureA{program351}%\begin{program}\begin{verbatim}void MyAgent::init(){  Conf::initialize("myconf.xml");  Behavior::createBehaviors();}\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program356}%\begin{program}\begin{verbatim}void MyBehavior::think(){  rf<Behavior> win = Behavior::getWin();  win->update();  win->setGoal(new Behavior::Goal);  win->achieveGoal();}\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}{\newpage\clearpage\lthtmlfigureA{program360}%\begin{program}\begin{verbatim}void MyBehavior::think(){  ...  Cerebellum& cer = Cerebellum::getInstance();    std::set<rf<Behavior> > acBehaviors = Behavior::getActionCommandBehaviors();  for (set<rf<Behavior> >::iterator iter = acBehaviors.begin(); iter != acBehaviors.end(); ++iter)  	cer.addAction((*iter)->getAction());    cer.outputCommands(d_comm);}\end{verbatim}\end{program}%\lthtmlfigureZ\lthtmlcheckvsize\clearpage}\appendix\stepcounter{chapter}\end{document}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -