亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? _tutorial.tex

?? The Little Green BATS is the first and so far only Dutch team in the 3D simulation league. We are a
?? TEX
?? 第 1 頁 / 共 2 頁
字號(hào):
\chapter{Tutorial}\label{chTutorial}The BATS agent architecture consists of several parts and layers. This tutorial guides you through using these parts step by step. All lower layers are independent of the higher layers. So if you don't need all, you can skip the later sections. If you are only interested in an easy interface with the simulation server, reading section \ref{secSocketComm} will suffice. If you want to start quickly with a working agent, you can skip until section \ref{secHumanoidAgent} for now. However, the agent template described there is based on the elements described in the sections before that, so be sure to read those too at some time, to fully understand how your agent works.\section{SocketComm}\label{secSocketComm}The lowest layer in our architecture manages the communication with the simulation server. This communication is done through TCP sockets and consists of S-expressions (predicates) that the agent and server send back and forth. The SocketComm handles the connection to the server and sending, receiving and parsing of the messages.When creating a SocketComm you have to supply a hostname and a port number to connect to. When running the server on the same computer as your agent with default settings, these are 'localhost' and '3100'. After creating a SocketComm, the first thing to do is open an actual connection by calling connect:\begin{program}\begin{verbatim}SocketComm comm("localhost", 3100);comm.connect();\end{verbatim}\end{program}The SocketComm keeps two internal message queues, one for input and one for output. These queues are filled and emptied, respectively, when calling SocketComm's update method. This call blocks until new data is received from the server:\begin{program}\begin {verbatim}comm.update();\end{verbatim}\end{program}SocketComm supplies several methods to place messages that should be sent to the server into the output queue. First of all, you can build your own predicate using the Predicate and/or Parser classes \footnote{This method is not described in this HowTo. Look at the documentation in the source code for more info} and put it directly into the queue by calling the send method:\begin{program}\begin{verbatim}rf<Predicate> myPredicate = makeMyPredicate();comm.send(myPredicate);\end{verbatim}\end{program}However, you can also leave the trouble of building the predicates to SocketComm by using the make*Message methods. These methods are also used by the init, beam and move* methods, which also place the messages directly into the queue for you.The input queue holds the messages received from the server. To check whether there is a new message you can call hasNextMessage, to extract the next message you can use nextMessage:\begin{program}\begin{verbatim}while (comm.hasNextMessage())  rf<Predicate> message = comm.nextMessage();\end{verbatim}\end{program}To conclude this section we present a typical way to have successful communication with the server:\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}\section{WorldModel}\label{secWorldModel}The SocketComm parses the S-expressions that the agent receives from the server into our Predicate structure. However, to extract useful data and keep a model of the world you still have to dig through these messages. In our architecture, WorldModel does exactly this, helping you avoid handling S-expressions/predicates completely on the input side. The WorldModel is a singleton object that encapsulates the SocketComm and provides a large number of methods to determine the world state.Before the WorldModel can be used, it has to be initialized by supplying a SocketComm that is connected to the server. To use the WorldModel, you have to get a reference to the singleton object:\begin{program}\begin{verbatim}WorldModel::initialize(comm);WorldModel& wm = WorldModel::getInstance();\end{verbatim}\end{program}The {\tt WorldModel} should be updated at the beginning of every time step. This updates the {\tt SocketComm} (so you don't have to call {\tt SocketComm::update()} yourself anymore), reads all messages from them and updates the internal model according to them:\begin{program}\begin{verbatim}wm.update();\end{verbatim}\end{program}After this you can request the states of the game, the world and the agent itself by calling WorldModel's methods. For a description of these, please look at the documentation of the source code.\section{Cerebellum}\label{secCerebellum}The same way WorldModel keeps you from having to work with predicates on the input site, the Cerebellum overlays the output interface. It supplies more useful structures to define actions and the possibility to integrate actions from different sources in your agent. The Cerebellum has the Action substructure and a few of its derivatives with which you can make new actions. At the moment there are 4 different usable action types:\begin{itemize}\item {\tt MoveJointAction} - Move a hinge joint or one axis of a universal joint\item {\tt MoveHingeJointAction} - Move a hinge joint\item {\tt MoveUniversalJointAction} - Move both axes of a universal joint\item {\tt BeamAction} - Beam to a certain position\end{itemize}The Cerebellum is, also like the WorldModel, a singleton that can be retrieved by calling {\tt Cerebellum::getInstance()} after which you can add actions to the Cerebellum. After all the sub parts have added their actions, you can call {\tt outputCommands()} to send the collections through a SocketComm:\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}When more than 1 action is supplied for a hinge joint or part of a universal joint, the given speeds will be averaged before sending to the server.\section{HumanoidAgent}\label{secHumanoidAgent}As said above, this section will show how to quickly set up an agent that connects to the server, reads and parses messages that come from it and has a think cycle in which you can easily send actions back. This is done by using the {\tt HumanoidAgent} class. It combines the classes described in the previous sections and creates an easy interface for new agents. To use it, you should create a class that inherits from it:\begin{program}\begin{verbatim}class MyAgent : public bats::HumanoidAgent{  public:    MyAgent(std::string teamName)    : bats::HumanoidAgent(teamName)    {}};\end{verbatim}\end{program}As you see, the constructor of the {\tt HumanoidAgent} class expects a team name. You can also give it a host name and port to use to connect to and a uniform number. By default the latter is set to 0, meaning that the server picks a free uniform number. To run the agent, all you have to do is make a new object of your agent class and call the {\tt run()} method on it:\begin{program}\begin{verbatim}int main(){  MyAgent agent("MyTeam");  agent.run();}\end{verbatim}\end{program}This runs the initialization code of the {\tt HumanoidAgent}, which connects it to the server, sends the needed initialization message, and calls the {\tt init()} method. Overload this method if your agent needs its own initialization code. After this, an infinite loop is started that updates the {\tt WorldModel} and calls the {\tt think()} method at each time step. If you want your agent to actually do something, overload this last method.\section{Behavior}\label{secBehavior}The code in the previous section implements an agent which connects to te server, gets placed in the field and then stands there until it falls over. Now it is time to let your agent behave. The BATS agent architecture supplies a hierarchical behavior model to help you with this by following these steps:\begin{itemize}\item Implement seperate behaviors\item Create a configuration file placing the behaviors in a hierarchical structure\item Create and run the behaviors\end{itemize}\subsection{Implementing a behavior}\label{subsecImplementingBehavior}The BATS agent architecture gives the {\tt Behavior} class as the building block of your agent. The basic thing to know is that a behavior receives a goal from a higher level behavior, creates subgoals that it wants to achieve in order to achieve the main goal and passes these goals to its subbehaviors. The behavior defines a sequence of slots in which arbitrary sub behaviors can be placed. This section shows how to create a behavior, section \ref{subsecConfiguration} will show how to define its super and sub behaviors.\subsubsection*{Inherit Behavior}The first thing to do when creating a new behavior is to create a class that inherits from the {\tt Behavior} class. It defines a couple of pure virtual methods that each behavior should implement (more on these later):\begin{program}\begin{verbatim}class MyBehavior : public Behavior{  virtual rf<Goal> generateGoal(unsigned step,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产品国语在线app| 日韩欧美高清在线| 欧美极品美女视频| 国模无码大尺度一区二区三区| 欧美另类videos死尸| 一区二区三区国产| 色综合久久中文综合久久97| 国产精品欧美一区喷水| 国产成人av网站| 国产视频亚洲色图| 粉嫩aⅴ一区二区三区四区五区| 久久综合五月天婷婷伊人| 精品一区二区三区在线观看 | 欧美性xxxxxxxx| 亚洲免费观看高清完整版在线观看熊| av电影在线观看不卡| 亚洲另类色综合网站| 色婷婷综合久色| 亚洲综合清纯丝袜自拍| 欧美日韩一区二区电影| 亚洲第一狼人社区| 欧美一区二区三区男人的天堂| 日韩一区精品字幕| 日韩三级av在线播放| 六月丁香综合在线视频| 欧美mv日韩mv| 国产精品自拍在线| 国产精品天干天干在线综合| 成人精品视频网站| 亚洲六月丁香色婷婷综合久久 | 天堂在线一区二区| 一区二区三区视频在线看| 蜜臀av性久久久久蜜臀aⅴ | 国产精品亲子伦对白| 制服丝袜亚洲色图| a亚洲天堂av| 国内成人自拍视频| 另类成人小视频在线| 99精品视频在线观看| 精品久久久久99| 国产精品88av| 亚洲色图视频网站| 欧美日韩国产一级二级| 九色综合国产一区二区三区| 欧美韩国日本综合| 91黄色小视频| 蜜臀a∨国产成人精品| 欧美极品美女视频| 欧美亚洲日本一区| 久久国产综合精品| 国产精品久久久久一区| 欧美日韩中文字幕一区二区| 蜜乳av一区二区三区| 日本一区二区免费在线| 在线中文字幕一区二区| 蜜桃av一区二区三区电影| 国产精品免费人成网站| 欧美视频在线一区| 国产精品资源站在线| 亚洲另类色综合网站| 欧美成人三级电影在线| 9色porny自拍视频一区二区| 日日夜夜免费精品| 国产欧美一区二区精品秋霞影院| 欧美综合亚洲图片综合区| 毛片基地黄久久久久久天堂| 亚洲国产精品v| 欧美美女喷水视频| 国产成人精品亚洲777人妖| 亚洲一区二区五区| 久久午夜色播影院免费高清| 在线免费观看成人短视频| 黄页视频在线91| 亚洲一区在线视频| 久久精品人人爽人人爽| 欧美日韩成人综合| 成人黄页毛片网站| 蜜臀久久99精品久久久久久9| 中文字幕一区二区三区av| 91精品午夜视频| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 狠狠狠色丁香婷婷综合激情| 亚洲激情图片一区| 久久九九全国免费| 欧美日韩免费在线视频| 国产一区二区三区精品视频| 欧美三电影在线| 国产精品视频一二三| 国产精品99久久久久久有的能看| 色婷婷精品久久二区二区蜜臀av| 91精品国产免费| 亚洲男人的天堂在线观看| 捆绑调教美女网站视频一区| 色偷偷久久一区二区三区| 欧美成人r级一区二区三区| 国产69精品久久久久毛片| 欧美精品久久久久久久久老牛影院| 4438x成人网最大色成网站| 国产精品综合在线视频| 午夜视频一区二区三区| 国产精品理伦片| 欧美主播一区二区三区| 亚洲免费观看视频| av动漫一区二区| 最新中文字幕一区二区三区 | 欧美精品vⅰdeose4hd| 成人高清视频在线| 国内精品嫩模私拍在线| 亚洲午夜久久久久久久久电影院 | 亚洲一区二区在线免费观看视频| 国产日韩欧美精品综合| 日韩久久久精品| 在线成人av网站| 在线精品视频一区二区三四| 成人激情免费网站| 粉嫩蜜臀av国产精品网站| 国内欧美视频一区二区| 六月婷婷色综合| 日韩在线播放一区二区| 亚洲一卡二卡三卡四卡| 亚洲三级电影网站| 中文字幕在线播放不卡一区| 国产拍揄自揄精品视频麻豆| 欧美精品一区二区久久婷婷| 日韩亚洲欧美在线| 91精品国产综合久久精品图片| 色偷偷一区二区三区| 色综合中文字幕国产 | 欧美四级电影网| 在线免费观看一区| 欧美亚洲国产一卡| 欧美色视频在线观看| 色婷婷av一区二区三区gif| 91在线云播放| 91蝌蚪porny九色| 91九色02白丝porn| 欧美性猛片aaaaaaa做受| 懂色av一区二区三区免费看| 成人国产精品视频| 99热精品国产| 日本韩国精品在线| 欧美性生活大片视频| 欧美日韩另类国产亚洲欧美一级| 国产成人综合自拍| 日韩理论在线观看| 中文字幕制服丝袜一区二区三区 | 日韩一区二区三区四区| 日本欧美一区二区在线观看| 精品国产网站在线观看| 国产a视频精品免费观看| 日韩伦理电影网| 久久久久久久免费视频了| 欧美精品一区二区三区四区 | 亚洲综合av网| 婷婷丁香激情综合| 强制捆绑调教一区二区| 国产尤物一区二区在线| 成人黄色在线网站| 91久久精品日日躁夜夜躁欧美| 欧美日韩成人综合天天影院 | 国产拍揄自揄精品视频麻豆| 亚洲色大成网站www久久九九| 亚洲一线二线三线久久久| 日本网站在线观看一区二区三区| 国产精品丝袜黑色高跟| 亚洲精品一二三| 亚洲电影你懂得| 麻豆91免费观看| 成人动漫一区二区三区| 国产不卡视频一区| 99国产精品99久久久久久| 欧美在线色视频| 欧美成人激情免费网| 欧美国产成人精品| 国产精品福利影院| 亚洲成人高清在线| 久久综合综合久久综合| 成人精品高清在线| 欧美乱妇一区二区三区不卡视频| 欧美成人一区二区三区| 日本一区二区不卡视频| 一区二区三区资源| 激情都市一区二区| 日本二三区不卡| 精品国产91九色蝌蚪| 亚洲欧洲综合另类| 奇米一区二区三区| 成人av一区二区三区| 欧美精品一级二级| 国产欧美一区二区精品婷婷| 亚洲一二三专区| 国产高清久久久| 欧美午夜精品理论片a级按摩| 26uuu亚洲| 亚洲一二三四区不卡| 国产精品99久久久久久似苏梦涵| 欧美自拍丝袜亚洲| 国产亚洲综合在线| 日本视频一区二区三区| av一区二区三区在线|