Unity 机器学习代理工具包 (ML-Agents) 是一个开源项目,它使游戏和模拟能够作为训练智能代理的环境。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

301 行
15 KiB

<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ML-Agents: Agent.cs File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygenbase.css" rel="stylesheet" type="text/css" />
<link href="unity.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">ML-Agents
&#160;<span id="projectnumber">v0.3</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('Agent_8cs.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<div class="title">Agent.cs File Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:structAgentInfo"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Agent_8cs.html#structAgentInfo">AgentInfo</a></td></tr>
<tr class="memdesc:structAgentInfo"><td class="mdescLeft">&#160;</td><td class="mdescRight">Struct that contains all the information for an <a class="el" href="classAgent.html" title="Agent Monobehavior class that is attached to a Unity GameObject, making it an Agent. ">Agent</a>, including its observations, actions and current status, that is sent to the Brain. <a href="Agent_8cs.html#structAgentInfo">More...</a><br /></td></tr>
<tr class="separator:structAgentInfo"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structAgentAction"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Agent_8cs.html#structAgentAction">AgentAction</a></td></tr>
<tr class="memdesc:structAgentAction"><td class="mdescLeft">&#160;</td><td class="mdescRight">Struct that contains the action information sent from the Brain to the <a class="el" href="classAgent.html" title="Agent Monobehavior class that is attached to a Unity GameObject, making it an Agent. ">Agent</a>. <a href="Agent_8cs.html#structAgentAction">More...</a><br /></td></tr>
<tr class="separator:structAgentAction"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:classAgentParameters"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Agent_8cs.html#classAgentParameters">AgentParameters</a></td></tr>
<tr class="memdesc:classAgentParameters"><td class="mdescLeft">&#160;</td><td class="mdescRight">Struct that contains all the Agent-specific parameters provided in the Editor. <a href="Agent_8cs.html#classAgentParameters">More...</a><br /></td></tr>
<tr class="separator:classAgentParameters"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAgent.html">Agent</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classAgent.html" title="Agent Monobehavior class that is attached to a Unity GameObject, making it an Agent. ">Agent</a> Monobehavior class that is attached to a Unity GameObject, making it an <a class="el" href="classAgent.html" title="Agent Monobehavior class that is attached to a Unity GameObject, making it an Agent. ">Agent</a>. <a href="classAgent.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Class Documentation</h2>
<a name="structAgentInfo" id="structAgentInfo"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structAgentInfo">&#9670;&nbsp;</a></span>AgentInfo</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct AgentInfo</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>Struct that contains all the information for an <a class="el" href="classAgent.html" title="Agent Monobehavior class that is attached to a Unity GameObject, making it an Agent. ">Agent</a>, including its observations, actions and current status, that is sent to the Brain. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Class Members</th></tr>
<tr><td class="fieldtype">
<a id="a1d39aac66e12dae50a24cd7a9100ef33"></a>bool</td>
<td class="fieldname">
done</td>
<td class="fielddoc">
Whether the agent is done or not. </td></tr>
<tr><td class="fieldtype">
<a id="a7441ef0865bcb3db9b8064dd7375c1ea"></a>int</td>
<td class="fieldname">
id</td>
<td class="fielddoc">
Unique identifier each agent receives at initialization. <p>It is used to separate between different agents in the environment. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a5b90735e18b8f5df83c465f78733f63d"></a>bool</td>
<td class="fieldname">
maxStepReached</td>
<td class="fielddoc">
Whether the agent has reached its max step count for this episode. </td></tr>
<tr><td class="fieldtype">
<a id="a2ef761809d305d84678380bbd1ae4cc9"></a>List&lt; float &gt;</td>
<td class="fieldname">
memories</td>
<td class="fielddoc">
Used by the Trainer to store information about the agent. <p>This data structure is not consumed or modified by the agent directly, they are just the owners of their trainier's memory. Currently, however, the size of the memory is in the Brain properties. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="ab18e03604d8452d6d86f55873e19732a"></a>float</td>
<td class="fieldname">
reward</td>
<td class="fielddoc">
Current agent reward. </td></tr>
<tr><td class="fieldtype">
<a id="a308a4987ac541acbd58a9cc9c96b1ace"></a>List&lt; float &gt;</td>
<td class="fieldname">
stackedVectorObservation</td>
<td class="fielddoc">
The previous agent vector observations, stacked. <p>The length of the history (i.e. number of vector observations to stack) is specified in the Brain parameters. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a16d35fb78652a70b50a8d9355da8cadd"></a>string</td>
<td class="fieldname">
storedTextActions</td>
<td class="fielddoc">
Keeps track of the last text action taken by the Brain. </td></tr>
<tr><td class="fieldtype">
<a id="ae5414923dbbbd2a39ab4e94d3061bbac"></a>float []</td>
<td class="fieldname">
storedVectorActions</td>
<td class="fielddoc">
Keeps track of the last vector action taken by the Brain. </td></tr>
<tr><td class="fieldtype">
<a id="ada2ee0fb0667ff7a98fa6e76734c0e1d"></a>string</td>
<td class="fieldname">
textObservation</td>
<td class="fielddoc">
Most recent text observation. </td></tr>
<tr><td class="fieldtype">
<a id="a35913fa60b0dd9d9a2fff5e9ea816181"></a>List&lt; float &gt;</td>
<td class="fieldname">
vectorObservation</td>
<td class="fielddoc">
Most recent agent vector (i.e. <p>numeric) observation. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a3e2c1c7c1fe14981c3bab872f999953d"></a>List&lt; Texture2D &gt;</td>
<td class="fieldname">
visualObservations</td>
<td class="fielddoc">
Most recent agent camera (i.e. <p>texture) observation. </p>
</td></tr>
</table>
</div>
</div>
<a name="structAgentAction" id="structAgentAction"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structAgentAction">&#9670;&nbsp;</a></span>AgentAction</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct AgentAction</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>Struct that contains the action information sent from the Brain to the <a class="el" href="classAgent.html" title="Agent Monobehavior class that is attached to a Unity GameObject, making it an Agent. ">Agent</a>. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Class Members</th></tr>
<tr><td class="fieldtype">
<a id="a2ef761809d305d84678380bbd1ae4cc9"></a>List&lt; float &gt;</td>
<td class="fieldname">
memories</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a id="af3a8b157b1eb809e256f68314db6e1bd"></a>string</td>
<td class="fieldname">
textActions</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a id="a56a7fa0379094a56a4158ac50dd31dd1"></a>float []</td>
<td class="fieldname">
vectorActions</td>
<td class="fielddoc">
</td></tr>
</table>
</div>
</div>
<a name="classAgentParameters" id="classAgentParameters"></a>
<h2 class="memtitle"><span class="permalink"><a href="#classAgentParameters">&#9670;&nbsp;</a></span>AgentParameters</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">class AgentParameters</td>
</tr>
</table>
</div><div class="memdoc">
<div class="textblock"><p>Struct that contains all the Agent-specific parameters provided in the Editor. </p>
<p>This excludes the Brain linked to the <a class="el" href="classAgent.html" title="Agent Monobehavior class that is attached to a Unity GameObject, making it an Agent. ">Agent</a> since it can be modified programmatically. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Class Members</th></tr>
<tr><td class="fieldtype">
<a id="a1e23676a7014ca3a552c39e9cfc1fb27"></a>List&lt; Camera &gt;</td>
<td class="fieldname">
agentCameras</td>
<td class="fielddoc">
The list of the Camera GameObjects the agent uses for visual observations. </td></tr>
<tr><td class="fieldtype">
<a id="a68defcf610c5210aa9a2b73fb4de6fbe"></a>int</td>
<td class="fieldname">
maxStep</td>
<td class="fielddoc">
The maximum number of steps the agent takes before being done. <p>If set to 0, the agent can only be set to done programmatically (or when the <a class="el" href="classAcademy.html" title="An Academy is where Agent objects go to train their behaviors. ">Academy</a> is done). If set to any positive integer, the agent will be set to done after that many steps. Note that setting the max step to a value greater than the academy max step value renders it useless. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="af84a8178eb8593c986c511a57b76305e"></a>int</td>
<td class="fieldname">
numberOfActionsBetweenDecisions</td>
<td class="fielddoc">
Number of actions between decisions (used when On Demand <a class="el" href="interfaceDecision.html" title="Interface for implementing the behavior of an Agent that uses a Heuristic Brain. ">Decision</a> Making is turned off). </td></tr>
<tr><td class="fieldtype">
<a id="adc9588e03d6582f35d1501d7f6c64e5a"></a>bool</td>
<td class="fieldname">
onDemandDecision</td>
<td class="fielddoc">
Whether to enable On Demand <a class="el" href="interfaceDecision.html" title="Interface for implementing the behavior of an Agent that uses a Heuristic Brain. ">Decision</a> Making or make a decision at every step. </td></tr>
<tr><td class="fieldtype">
<a id="a1e06d6fe173ee1f37c3b7a9af8050195"></a>bool</td>
<td class="fieldname">
resetOnDone</td>
<td class="fielddoc">
Determines the behaviour of the agent when done. <p>If true, the agent will reset when done and start a new episode. Otherwise, the agent will remain done and its behavior will be dictated by the AgentOnDone method. </p>
</td></tr>
</table>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_9e08e342c98e8c75a023f201773b55cc.html">unity-environment</a></li><li class="navelem"><a class="el" href="dir_9e5f09d06b09d6d0595ae4f95bbd32cf.html">Assets</a></li><li class="navelem"><a class="el" href="dir_b9aa27b295bc425ceb05fbd0ed2def0d.html">ML-Agents</a></li><li class="navelem"><a class="el" href="dir_8e3ee7c563cfd76ab73fa6d2b0b4bf82.html">Scripts</a></li><li class="navelem"><a class="el" href="Agent_8cs.html">Agent.cs</a></li>
</ul>
</div>
</body>
</html>