浏览代码

apply auto-formatting

/bug-failed-api-check
Chris Elion 5 年前
当前提交
a2ad53be
共有 8 个文件被更改,包括 30 次插入29 次删除
  1. 1
      com.unity.ml-agents/Editor/CameraSensorComponentEditor.cs
  2. 13
      com.unity.ml-agents/Editor/RayPerceptionSensorComponentBaseEditor.cs
  3. 25
      com.unity.ml-agents/Runtime/Agent.cs
  4. 5
      com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs
  5. 2
      com.unity.ml-agents/Runtime/Policies/BehaviorParameters.cs
  6. 6
      com.unity.ml-agents/Runtime/Policies/BrainParameters.cs
  7. 4
      com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensorComponentBase.cs
  8. 3
      com.unity.ml-agents/Runtime/SideChannels/FloatPropertiesChannel.cs

1
com.unity.ml-agents/Editor/CameraSensorComponentEditor.cs


var sensorComponent = serializedObject.targetObject as CameraSensorComponent;
sensorComponent?.UpdateSensor();
}
}
}

13
com.unity.ml-agents/Editor/RayPerceptionSensorComponentBaseEditor.cs


UpdateSensorIfDirty();
}
if (m_RequireSensorUpdate)
{
var sensorComponent = serializedObject.targetObject as RayPerceptionSensorComponentBase;
sensorComponent?.UpdateSensor();
m_RequireSensorUpdate = false;
}
if (m_RequireSensorUpdate)
{
var sensorComponent = serializedObject.targetObject as RayPerceptionSensorComponentBase;
sensorComponent?.UpdateSensor();
m_RequireSensorUpdate = false;
}
}
}

25
com.unity.ml-agents/Runtime/Agent.cs


/// <summary>
/// The team ID for this Agent.
/// </summary>
public int TeamId {
get {
public int TeamId
{
get
{
}
}
public string BehaviorName {
get {
public string BehaviorName
{
get
{
}
}
}
[SerializeField][HideInInspector]

m_Brain?.RequestDecision(m_Info, sensors);
// We also have to write any to any DemonstationStores so that they get the "done" flag.
foreach(var demoWriter in DemonstrationWriters)
foreach (var demoWriter in DemonstrationWriters)
{
demoWriter.Record(m_Info, sensors);
}

{
m_RequestAction = true;
}
/// Helper function that resets all the data structures associated with
/// the agent. Typically used when the agent is being initialized or reset

m_Brain.RequestDecision(m_Info, sensors);
// If we have any DemonstrationWriters, write the AgentInfo and sensors to them.
foreach(var demoWriter in DemonstrationWriters)
foreach (var demoWriter in DemonstrationWriters)
{
demoWriter.Record(m_Info, sensors);
}

sensor.Update();
}
}
/// <summary>
/// Collects the vector observations of the agent.

void DecideAction()
{
m_Action.vectorActions = m_Brain?.DecideAction();
if (m_Action.vectorActions == null){
if (m_Action.vectorActions == null)
{
ResetData();
}
}

5
com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs


"Python library version: {2}.",
pythonCommunicationVersion, initParameters.unityCommunicationVersion,
pythonPackageVersion
);
);
}
else
{

/// <param name="dataReceived">The byte array of data received from Python.</param>
public static void ProcessSideChannelData(Dictionary<Guid, SideChannel> sideChannels, byte[] dataReceived)
{
while(m_CachedMessages.Count!=0)
while (m_CachedMessages.Count != 0)
{
var cachedMessage = m_CachedMessages.Dequeue();
if (sideChannels.ContainsKey(cachedMessage.ChannelId))

2
com.unity.ml-agents/Runtime/Policies/BehaviorParameters.cs


namespace MLAgents.Policies
{
/// <summary>
/// Defines what type of behavior the Agent will be using
/// </summary>

[AddComponentMenu("ML Agents/Behavior Parameters", (int)MenuGroup.Default)]
internal class BehaviorParameters : MonoBehaviour
{
[HideInInspector]
[SerializeField]
BrainParameters m_BrainParameters = new BrainParameters();

6
com.unity.ml-agents/Runtime/Policies/BrainParameters.cs


public int numActions
{
get{
switch(vectorActionSpaceType){
get
{
switch (vectorActionSpaceType)
{
case SpaceType.Discrete:
return vectorActionSize.Length;
case SpaceType.Continuous:

4
com.unity.ml-agents/Runtime/Sensors/RayPerceptionSensorComponentBase.cs


[HideInInspector, SerializeField, FormerlySerializedAs("maxRayDegrees")]
[Range(0, 180)]
[Tooltip("Cone size for rays. Using 90 degrees will cast rays to the left and right. " +
"Greater than 90 degrees will go backwards.")]
"Greater than 90 degrees will go backwards.")]
float m_MaxRayDegrees = 70;
/// <summary>

/// <summary>
/// Draw the debug information from the sensor (if available).
/// </summary>
void DrawRaycastGizmos(DebugDisplayInfo.RayInfo rayInfo, float alpha=1.0f)
void DrawRaycastGizmos(DebugDisplayInfo.RayInfo rayInfo, float alpha = 1.0f)
{
var startPositionWorld = rayInfo.worldStart;
var endPositionWorld = rayInfo.worldEnd;

3
com.unity.ml-agents/Runtime/SideChannels/FloatPropertiesChannel.cs


{
ChannelId = new Guid(k_FloatPropertiesDefaultId);
}
else{
else
{
ChannelId = channelId;
}
}

正在加载...
取消
保存