Skip to content

Commit 4f201b0

Browse files
Chris Elionvincentpierre
andauthored
Misc doc fixes (#4483)
* Fix inheritdoc usage * undo barracuda changes * fix \'the the\' * reword * tweaks to env build instructions * changelog * Update docs/Learning-Environment-Executable.md Co-authored-by: Vincent-Pierre BERGES <[email protected]> Co-authored-by: Vincent-Pierre BERGES <[email protected]>
1 parent c54197a commit 4f201b0

File tree

9 files changed

+33
-58
lines changed

9 files changed

+33
-58
lines changed

com.unity.ml-agents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ a compatible version of the trainer. (#4462)
4343
(#4434)
4444
- You can now again specify a default configuration for your behaviors. Specify `default_settings` in
4545
your trainer configuration to do so. (#4448)
46+
- Improved the executable detection logic for environments on Windows. (#4485)
4647

4748
### Bug Fixes
4849
#### com.unity.ml-agents (C#)

com.unity.ml-agents/Documentation~/filter.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ apiRules:
88
- exclude:
99
uidRegex: ^Unity.MLAgents\.Tests\.Communicator$
1010
type: Namespace
11+
- exclude:
12+
uidRegex: ^Unity.MLAgents\.Tests\.Actuators$
13+
type: Namespace
1114
- exclude:
1215
uidRegex: ^Unity.MLAgents\.Editor$
1316
type: Namespace

com.unity.ml-agents/Runtime/Actuators/ActionSegment.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,19 @@ public void Clear()
107107
System.Array.Clear(Array, Offset, Length);
108108
}
109109

110-
/// <inheritdoc cref="IEnumerable{T}.GetEnumerator"/>
110+
/// <inheritdoc/>
111111
IEnumerator<T> IEnumerable<T>.GetEnumerator()
112112
{
113113
return new Enumerator(this);
114114
}
115115

116-
/// <inheritdoc cref="IEnumerable{T}"/>
116+
/// <inheritdoc/>
117117
public IEnumerator GetEnumerator()
118118
{
119119
return new Enumerator(this);
120120
}
121121

122-
/// <inheritdoc cref="ValueType.Equals(object)"/>
122+
/// <inheritdoc/>
123123
public override bool Equals(object obj)
124124
{
125125
if (!(obj is ActionSegment<T>))
@@ -129,13 +129,13 @@ public override bool Equals(object obj)
129129
return Equals((ActionSegment<T>)obj);
130130
}
131131

132-
/// <inheritdoc cref="IEquatable{T}.Equals(T)"/>
132+
/// <inheritdoc/>
133133
public bool Equals(ActionSegment<T> other)
134134
{
135135
return Offset == other.Offset && Length == other.Length && Array.SequenceEqual(other.Array);
136136
}
137137

138-
/// <inheritdoc cref="ValueType.GetHashCode"/>
138+
/// <inheritdoc/>
139139
public override int GetHashCode()
140140
{
141141
unchecked

com.unity.ml-agents/Runtime/Actuators/ActuatorDiscreteActionMask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal ActuatorDiscreteActionMask(IList<IActuator> actuators, int sumOfDiscret
3535
m_BranchSizes = branchSizes;
3636
}
3737

38-
/// <inheritdoc cref="IDiscreteActionMask.WriteMask"/>
38+
/// <inheritdoc/>
3939
public void WriteMask(int branch, IEnumerable<int> actionIndices)
4040
{
4141
LazyInitialize();
@@ -84,7 +84,7 @@ void LazyInitialize()
8484
}
8585
}
8686

87-
/// <inheritdoc cref="IDiscreteActionMask.GetMask"/>
87+
/// <inheritdoc/>
8888
public bool[] GetMask()
8989
{
9090
#if DEBUG

com.unity.ml-agents/Runtime/Actuators/ActuatorManager.cs

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ public void ResetData()
261261
m_DiscreteActionMask.ResetMask();
262262
}
263263

264-
265264
/// <summary>
266265
/// Sorts the <see cref="IActuator"/>s according to their <see cref="IActuator.Name"/> value.
267266
/// </summary>
@@ -335,26 +334,19 @@ void ClearBufferSizes()
335334
* IList implementation that delegates to m_Actuators List. *
336335
*********************************************************************************/
337336

338-
/// <summary>
339-
/// <inheritdoc cref="IEnumerable{T}.GetEnumerator"/>
340-
/// </summary>
337+
/// <inheritdoc/>
341338
public IEnumerator<IActuator> GetEnumerator()
342339
{
343340
return m_Actuators.GetEnumerator();
344341
}
345342

346-
/// <summary>
347-
/// <inheritdoc cref="IList{T}.GetEnumerator"/>
348-
/// </summary>
343+
/// <inheritdoc/>
349344
IEnumerator IEnumerable.GetEnumerator()
350345
{
351346
return ((IEnumerable)m_Actuators).GetEnumerator();
352347
}
353348

354-
/// <summary>
355-
/// <inheritdoc cref="ICollection{T}.Add"/>
356-
/// </summary>
357-
/// <param name="item"></param>
349+
/// <inheritdoc/>
358350
public void Add(IActuator item)
359351
{
360352
Debug.Assert(m_ReadyForExecution == false,
@@ -363,9 +355,7 @@ public void Add(IActuator item)
363355
AddToBufferSizes(item);
364356
}
365357

366-
/// <summary>
367-
/// <inheritdoc cref="ICollection{T}.Clear"/>
368-
/// </summary>
358+
/// <inheritdoc/>
369359
public void Clear()
370360
{
371361
Debug.Assert(m_ReadyForExecution == false,
@@ -374,25 +364,19 @@ public void Clear()
374364
ClearBufferSizes();
375365
}
376366

377-
/// <summary>
378-
/// <inheritdoc cref="ICollection{T}.Contains"/>
379-
/// </summary>
367+
/// <inheritdoc/>
380368
public bool Contains(IActuator item)
381369
{
382370
return m_Actuators.Contains(item);
383371
}
384372

385-
/// <summary>
386-
/// <inheritdoc cref="ICollection{T}.CopyTo"/>
387-
/// </summary>
373+
/// <inheritdoc/>
388374
public void CopyTo(IActuator[] array, int arrayIndex)
389375
{
390376
m_Actuators.CopyTo(array, arrayIndex);
391377
}
392378

393-
/// <summary>
394-
/// <inheritdoc cref="ICollection{T}.Remove"/>
395-
/// </summary>
379+
/// <inheritdoc/>
396380
public bool Remove(IActuator item)
397381
{
398382
Debug.Assert(m_ReadyForExecution == false,
@@ -405,27 +389,19 @@ public bool Remove(IActuator item)
405389
return false;
406390
}
407391

408-
/// <summary>
409-
/// <inheritdoc cref="ICollection{T}.Count"/>
410-
/// </summary>
392+
/// <inheritdoc/>
411393
public int Count => m_Actuators.Count;
412394

413-
/// <summary>
414-
/// <inheritdoc cref="ICollection{T}.IsReadOnly"/>
415-
/// </summary>
395+
/// <inheritdoc/>
416396
public bool IsReadOnly => m_Actuators.IsReadOnly;
417397

418-
/// <summary>
419-
/// <inheritdoc cref="IList{T}.IndexOf"/>
420-
/// </summary>
398+
/// <inheritdoc/>
421399
public int IndexOf(IActuator item)
422400
{
423401
return m_Actuators.IndexOf(item);
424402
}
425403

426-
/// <summary>
427-
/// <inheritdoc cref="IList{T}.Insert"/>
428-
/// </summary>
404+
/// <inheritdoc/>
429405
public void Insert(int index, IActuator item)
430406
{
431407
Debug.Assert(m_ReadyForExecution == false,
@@ -434,9 +410,7 @@ public void Insert(int index, IActuator item)
434410
AddToBufferSizes(item);
435411
}
436412

437-
/// <summary>
438-
/// <inheritdoc cref="IList{T}.RemoveAt"/>
439-
/// </summary>
413+
/// <inheritdoc/>
440414
public void RemoveAt(int index)
441415
{
442416
Debug.Assert(m_ReadyForExecution == false,
@@ -446,9 +420,7 @@ public void RemoveAt(int index)
446420
m_Actuators.RemoveAt(index);
447421
}
448422

449-
/// <summary>
450-
/// <inheritdoc cref="IList{T}.this"/>
451-
/// </summary>
423+
/// <inheritdoc/>
452424
public IActuator this[int index]
453425
{
454426
get => m_Actuators[index];

com.unity.ml-agents/Runtime/Actuators/IActionReceiver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void Clear()
7070
DiscreteActions.Clear();
7171
}
7272

73-
/// <inheritdoc cref="ValueType.Equals(object)"/>
73+
/// <inheritdoc/>
7474
public override bool Equals(object obj)
7575
{
7676
if (!(obj is ActionBuffers))
@@ -83,7 +83,7 @@ public override bool Equals(object obj)
8383
ab.DiscreteActions.SequenceEqual(DiscreteActions);
8484
}
8585

86-
/// <inheritdoc cref="ValueType.GetHashCode"/>
86+
/// <inheritdoc/>
8787
public override int GetHashCode()
8888
{
8989
unchecked

com.unity.ml-agents/Runtime/Actuators/VectorActuator.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ public void WriteDiscreteActionMask(IDiscreteActionMask actionMask)
7171
m_ActionReceiver.WriteDiscreteActionMask(actionMask);
7272
}
7373

74-
/// <summary>
75-
/// <inheritdoc cref="IActionReceiver.ActionSpec"/>
76-
/// </summary>
74+
/// <inheritdoc/>
7775
public ActionSpec ActionSpec { get; }
7876

7977
/// <inheritdoc />

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ public virtual void CollectObservations(VectorSensor sensor)
10961096
/// <summary>
10971097
/// Returns a read-only view of the observations that were generated in
10981098
/// <see cref="CollectObservations(VectorSensor)"/>. This is mainly useful inside of a
1099-
/// <see cref="Heuristic(float[], int[])"/> method to avoid recomputing the observations.
1099+
/// <see cref="Heuristic(in ActionBuffers)"/> method to avoid recomputing the observations.
11001100
/// </summary>
11011101
/// <returns>A read-only view of the observations list.</returns>
11021102
public ReadOnlyCollection<float> GetObservations()
@@ -1145,7 +1145,7 @@ public virtual void WriteDiscreteActionMask(IDiscreteActionMask actionMask)
11451145
/// three values in the action array to use as the force components. During
11461146
/// training, the agent's policy learns to set those particular elements of
11471147
/// the array to maximize the training rewards the agent receives. (Of course,
1148-
/// if you implement a <seealso cref="Heuristic(float[], int[])"/> function, it must use the same
1148+
/// if you implement a <seealso cref="Heuristic(in ActionBuffers)"/> function, it must use the same
11491149
/// elements of the action array for the same purpose since there is no learning
11501150
/// involved.)
11511151
///

docs/Learning-Environment-Executable.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ over using the Editor:
77
- You can exchange executable with other people without having to share your
88
entire repository.
99
- You can put your executable on a remote machine for faster training.
10-
- You can use `Headless` mode for faster training.
10+
- You can use `Server Build` (`Headless`) mode for faster training (as long as the executable does not need rendering).
1111
- You can keep using the Unity Editor for other tasks while the agents are
1212
training.
1313

@@ -37,7 +37,8 @@ launches our environment executable. This means:
3737
1. Open Player Settings (menu: **Edit** > **Project Settings** > **Player**).
3838
1. Under **Resolution and Presentation**:
3939
- Ensure that **Run in Background** is Checked.
40-
- Ensure that **Display Resolution Dialog** is set to Disabled.
40+
- Ensure that **Display Resolution Dialog** is set to Disabled. (Note: this
41+
setting may not be available in newer versions of the editor.)
4142
1. Open the Build Settings window (menu:**File** > **Build Settings**).
4243
1. Choose your target platform.
4344
- (optional) Select “Development Build” to
@@ -85,7 +86,7 @@ env = UnityEnvironment(file_name=<env_name>)
8586
- `<run-identifier>` is a string used to separate the results of different
8687
training runs
8788

88-
For example, if you are training with a 3DBall executable you exported to the
89+
For example, if you are training with a 3DBall executable, and you saved it to
8990
the directory where you installed the ML-Agents Toolkit, run:
9091

9192
```sh

0 commit comments

Comments
 (0)