Skip to content

Commit 44fe48e

Browse files
author
Chris Elion
authored
[WIP] 2.0 verified to main (#5385)
1 parent cfd4a59 commit 44fe48e

File tree

17 files changed

+46
-51
lines changed

17 files changed

+46
-51
lines changed

.yamato/com.unity.ml-agents-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test_editors:
77
- version: 2020.2
88
testProject: DevProject
99
enableNoDefaultPackages: !!bool true
10-
- version: 2021.1
10+
- version: 2021.2
1111
testProject: DevProject
1212
enableNoDefaultPackages: !!bool true
1313

.yamato/test_versions.metafile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ test_editors:
77
extra_test: gym
88
- version: 2020.3
99
extra_test: sensor
10-
- version: 2021.1
10+
- version: 2021.2
1111
extra_test: llapi

DevProject/Packages/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
77
"com.unity.package-manager-doctools": "1.7.0-preview",
88
"com.unity.package-validation-suite": "0.19.0-preview",
9-
"com.unity.test-framework": "1.1.22",
9+
"com.unity.test-framework": "1.1.24",
1010
"com.unity.test-framework.performance": "2.2.0-preview",
1111
"com.unity.testtools.codecoverage": "1.0.0-pre.3",
1212
"com.unity.modules.imageconversion": "1.0.0",

DevProject/Packages/packages-lock.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dependencies": {
33
"com.unity.barracuda": {
4-
"version": "1.4.0-preview",
4+
"version": "2.0.0-pre.3",
55
"depth": 1,
66
"source": "registry",
77
"dependencies": {
@@ -55,7 +55,7 @@
5555
"depth": 0,
5656
"source": "local",
5757
"dependencies": {
58-
"com.unity.barracuda": "1.4.0-preview",
58+
"com.unity.barracuda": "2.0.0-pre.3",
5959
"com.unity.modules.imageconversion": "1.0.0",
6060
"com.unity.modules.jsonserialize": "1.0.0"
6161
}
@@ -112,7 +112,7 @@
112112
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
113113
},
114114
"com.unity.test-framework": {
115-
"version": "1.1.22",
115+
"version": "1.1.24",
116116
"depth": 0,
117117
"source": "registry",
118118
"dependencies": {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2020.3.0f1
2-
m_EditorVersionWithRevision: 2020.3.0f1 (c7b5465681fb)
1+
m_EditorVersion: 2020.3.5f1
2+
m_EditorVersionWithRevision: 2020.3.5f1 (8095aa901b9b)

Project/Packages/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
66
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
77
"com.unity.nuget.newtonsoft-json": "2.0.0",
8-
"com.unity.test-framework": "1.1.22",
8+
"com.unity.test-framework": "1.1.24",
99
"com.unity.toolchain.macos-x86_64-linux-x86_64": "0.1.20-preview",
1010
"com.unity.ugui": "1.0.0",
1111
"com.unity.modules.imageconversion": "1.0.0",

Project/Packages/packages-lock.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"dependencies": {
33
"com.unity.barracuda": {
4-
"version": "1.4.0-preview",
4+
"version": "2.0.0-pre.3",
55
"depth": 1,
66
"source": "registry",
77
"dependencies": {
@@ -53,7 +53,7 @@
5353
"depth": 0,
5454
"source": "local",
5555
"dependencies": {
56-
"com.unity.barracuda": "1.4.0-preview",
56+
"com.unity.barracuda": "2.0.0-pre.3",
5757
"com.unity.modules.imageconversion": "1.0.0",
5858
"com.unity.modules.jsonserialize": "1.0.0"
5959
}
@@ -91,7 +91,7 @@
9191
"url": "https://packages.unity.com"
9292
},
9393
"com.unity.test-framework": {
94-
"version": "1.1.22",
94+
"version": "1.1.24",
9595
"depth": 0,
9696
"source": "registry",
9797
"dependencies": {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2019.4.20f1
2-
m_EditorVersionWithRevision: 2019.4.20f1 (6dd1c08eedfa)
1+
m_EditorVersion: 2019.4.25f1
2+
m_EditorVersionWithRevision: 2019.4.25f1 (01a0494af254)

com.unity.ml-agents/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to
1010
### Major Changes
1111
### Minor Changes
1212
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
13+
- update Barracuda to 2.0.0-pre.3. (#5385)
1314
- Fixed NullReferenceException when adding Behavior Parameters with no Agent. (#5382)
1415
#### ml-agents / ml-agents-envs / gym-unity (Python)
1516
- Added a fully connected visual encoder for environments with very small image inputs. (#5351)

com.unity.ml-agents/Documentation~/com.unity.ml-agents.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The _ML-Agents_ package contains the primary C# SDK for the [Unity ML-Agents
44
Toolkit].
55

6-
The package allows you to convert any Unity scene to into a learning environment
6+
The package allows you to convert any Unity scene into a learning environment
77
and train character behaviors using a variety of machine learning algorithms.
88
Additionally, it allows you to embed these trained behaviors back into Unity
99
scenes to control your characters. More specifically, the package provides the
@@ -12,7 +12,7 @@ following core functionalities:
1212
- Define Agents: entities, or characters, whose behavior will be learned. Agents
1313
are entities that generate observations (through sensors), take actions, and
1414
receive rewards from the environment.
15-
- Define Behaviors: entities that specifiy how an agent should act. Multiple
15+
- Define Behaviors: entities that specify how an agent should act. Multiple
1616
agents can share the same Behavior and a scene may have multiple Behaviors.
1717
- Record demonstrations of an agent within the Editor. You can use
1818
demonstrations to help train a behavior for that agent.
@@ -55,7 +55,7 @@ To install the companion Python package to enable training behaviors, follow the
5555
[installation instructions] on our [GitHub repository].
5656

5757
### Advanced Installation
58-
With the changes to Unity Package Manager in 2021, experimental packages will not show up in package list and have to be installed manually. There are two recommended ways to install the package manually:
58+
With the changes to Unity Package Manager in 2021, experimental packages will not show up in the package list and have to be installed manually. There are two recommended ways to install the package manually:
5959

6060
#### Github via Package Manager
6161

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
apiRules:
22
- exclude:
3-
uidRegex: ^Unity.MLAgents\.Tests$
3+
uidRegex: .*Test.*
44
type: Namespace
55
- exclude:
66
uidRegex: ^Unity.MLAgents\.CommunicatorObjects$
77
type: Namespace
8-
- exclude:
9-
uidRegex: ^Unity.MLAgents\.Tests\.Communicator$
10-
type: Namespace
11-
- exclude:
12-
uidRegex: ^Unity.MLAgents\.Tests\.Actuators$
13-
type: Namespace
148
- exclude:
159
uidRegex: ^Unity.MLAgents\.Editor$
1610
type: Namespace

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ public interface IDiscreteActionMask
1111
/// <remarks>
1212
/// By default, all discrete actions are allowed.
1313
/// If isEnabled is false, the agent will not be able to perform the actions passed as argument
14-
/// at the next decision for the specified action branch. The actionIndex correspond
14+
/// at the next decision for the specified action branch. The actionIndex corresponds
1515
/// to the action options the agent will be unable to perform.
1616
///
1717
/// See [Agents - Actions] for more information on masking actions.
1818
///
19-
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#actions
19+
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#masking-discrete-actions
2020
/// </remarks>
2121
/// <param name="branch">The branch for which the actions will be masked.</param>
22-
/// <param name="actionIndex">Index of the action</param>
23-
/// <param name="isEnabled">Whether the action is allowed or now.</param>
22+
/// <param name="actionIndex">Index of the action.</param>
23+
/// <param name="isEnabled">Whether the action is allowed or not.</param>
2424
void SetActionEnabled(int branch, int actionIndex, bool isEnabled);
2525
}
2626
}

com.unity.ml-agents/Runtime/Integrations/Match3/AbstractBoard.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public struct BoardSize
4141
public static bool operator <=(BoardSize lhs, BoardSize rhs)
4242
{
4343
return lhs.Rows <= rhs.Rows && lhs.Columns <= rhs.Columns && lhs.NumCellTypes <= rhs.NumCellTypes &&
44-
lhs.NumSpecialTypes <= rhs.NumSpecialTypes;
44+
lhs.NumSpecialTypes <= rhs.NumSpecialTypes;
4545
}
4646

4747
/// <summary>
@@ -53,7 +53,7 @@ public struct BoardSize
5353
public static bool operator >=(BoardSize lhs, BoardSize rhs)
5454
{
5555
return lhs.Rows >= rhs.Rows && lhs.Columns >= rhs.Columns && lhs.NumCellTypes >= rhs.NumCellTypes &&
56-
lhs.NumSpecialTypes >= rhs.NumSpecialTypes;
56+
lhs.NumSpecialTypes >= rhs.NumSpecialTypes;
5757
}
5858

5959
/// <summary>
@@ -81,8 +81,8 @@ public abstract class AbstractBoard : MonoBehaviour
8181

8282
/// <summary>
8383
/// Return the current size of the board. The values must less than or equal to the values returned from
84-
/// GetMaxBoardSize().
85-
/// By default, this will return GetMaxBoardSize(); if your board doesn't change size, you don't need to
84+
/// <see cref="GetMaxBoardSize"/>.
85+
/// By default, this will return <see cref="GetMaxBoardSize"/>; if your board doesn't change size, you don't need to
8686
/// override it.
8787
/// </summary>
8888
/// <returns></returns>
@@ -93,7 +93,7 @@ public virtual BoardSize GetCurrentBoardSize()
9393

9494
/// <summary>
9595
/// Returns the "color" of the piece at the given row and column.
96-
/// This should be between 0 and NumCellTypes-1 (inclusive).
96+
/// This should be between 0 and BoardSize.NumCellTypes-1 (inclusive).
9797
/// The actual order of the values doesn't matter.
9898
/// </summary>
9999
/// <param name="row"></param>
@@ -103,7 +103,7 @@ public virtual BoardSize GetCurrentBoardSize()
103103

104104
/// <summary>
105105
/// Returns the special type of the piece at the given row and column.
106-
/// This should be between 0 and NumSpecialTypes (inclusive).
106+
/// This should be between 0 and BoardSize.NumSpecialTypes (inclusive).
107107
/// The actual order of the values doesn't matter.
108108
/// </summary>
109109
/// <param name="row"></param>
@@ -113,23 +113,23 @@ public virtual BoardSize GetCurrentBoardSize()
113113

114114
/// <summary>
115115
/// Check whether the particular Move is valid for the game.
116-
/// The actual results will depend on the rules of the game, but we provide SimpleIsMoveValid()
116+
/// The actual results will depend on the rules of the game, but we provide <see cref="SimpleIsMoveValid(Move)"/>
117117
/// that handles basic match3 rules with no special or immovable pieces.
118118
/// </summary>
119119
/// <remarks>
120-
/// Moves that would go outside of GetCurrentBoardSize() are filtered out before they are
120+
/// Moves that would go outside of <see cref="GetCurrentBoardSize"/> are filtered out before they are
121121
/// passed to IsMoveValid().
122122
/// </remarks>
123-
/// <param name="m"></param>
123+
/// <param name="m">The move to check.</param>
124124
/// <returns></returns>
125125
public abstract bool IsMoveValid(Move m);
126126

127127
/// <summary>
128-
/// Instruct the game to make the given Move. Returns true if the move was made.
128+
/// Instruct the game to make the given <see cref="Move"/>. Returns true if the move was made.
129129
/// Note that during training, a move that was marked as invalid may occasionally still be
130130
/// requested. If this happens, it is safe to do nothing and request another move.
131131
/// </summary>
132-
/// <param name="m"></param>
132+
/// <param name="m">The move to carry out.</param>
133133
/// <returns></returns>
134134
public abstract bool MakeMove(Move m);
135135

@@ -149,7 +149,7 @@ public int NumMoves()
149149
public Action OnNoValidMovesAction;
150150

151151
/// <summary>
152-
/// Iterate through all Moves on the board.
152+
/// Iterate through all moves on the board.
153153
/// </summary>
154154
/// <returns></returns>
155155
public IEnumerable<Move> AllMoves()
@@ -169,7 +169,7 @@ public IEnumerable<Move> AllMoves()
169169
}
170170

171171
/// <summary>
172-
/// Iterate through all valid Moves on the board.
172+
/// Iterate through all valid moves on the board.
173173
/// </summary>
174174
/// <returns></returns>
175175
public IEnumerable<Move> ValidMoves()
@@ -189,9 +189,9 @@ public IEnumerable<Move> ValidMoves()
189189
}
190190

191191
/// <summary>
192-
/// Returns true if swapped the cells specified by the move would result in
192+
/// Returns true if swapping the cells specified by the move would result in
193193
/// 3 or more cells of the same type in a row. This assumes that all pieces are allowed
194-
/// to be moved; to add extra logic, incorporate it into you IsMoveValid() method.
194+
/// to be moved; to add extra logic, incorporate it into your <see cref="IsMoveValid"/> method.
195195
/// </summary>
196196
/// <param name="move"></param>
197197
/// <returns></returns>
@@ -226,7 +226,7 @@ public bool SimpleIsMoveValid(Move move)
226226

227227
/// <summary>
228228
/// Check if one of the cells that is swapped during a move matches 3 or more.
229-
/// Since these checks are similar for each cell, we consider the Move as two "half moves".
229+
/// Since these checks are similar for each cell, we consider the move as two "half moves".
230230
/// </summary>
231231
/// <param name="newRow"></param>
232232
/// <param name="newCol"></param>
@@ -291,7 +291,7 @@ bool CheckHalfMove(int newRow, int newCol, int newValue, Direction incomingDirec
291291
}
292292

293293
/// <summary>
294-
/// Make sure that the current BoardSize isn't larger than the original value of GetMaxBoardSize().
294+
/// Make sure that the current BoardSize isn't larger than the original value of <see cref="GetMaxBoardSize"/>.
295295
/// If it is, log a warning.
296296
/// </summary>
297297
/// <param name="originalMaxBoardSize"></param>

com.unity.ml-agents/Runtime/Integrations/Match3/Match3SensorComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public override ISensor[] CreateSensors()
5050
return Array.Empty<ISensor>();
5151
}
5252
var cellSensor = Match3Sensor.CellTypeSensor(board, m_ObservationType, m_SensorName + " (cells)");
53-
// This can be null if numSpecialTypes is 0
53+
// This can be null if BoardSize.NumSpecialTypes is 0
5454
var specialSensor = Match3Sensor.SpecialTypeSensor(board, m_ObservationType, m_SensorName + " (special)");
5555
m_Sensors = specialSensor != null
5656
? new ISensor[] { cellSensor, specialSensor }

com.unity.ml-agents/Runtime/Sensors/ISensor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public interface ISensor
5757
/// Returns a description of the observations that will be generated by the sensor.
5858
/// See <see cref="ObservationSpec"/> for more details, and helper methods to create one.
5959
/// </summary>
60-
/// <returns></returns>
60+
/// <returns>An object describing the observation.</returns>
6161
ObservationSpec GetObservationSpec();
6262

6363
/// <summary>
@@ -92,7 +92,7 @@ public interface ISensor
9292
/// Return information on the compression type being used. If no compression is used, return
9393
/// <see cref="CompressionSpec.Default()"/>.
9494
/// </summary>
95-
/// <returns>CompressionSpec used by the sensor.</returns>
95+
/// <returns>An object describing the compression used by the sensor.</returns>
9696
CompressionSpec GetCompressionSpec();
9797

9898
/// <summary>

com.unity.ml-agents/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"unity": "2019.4",
66
"description": "Use state-of-the-art machine learning to create intelligent character behaviors in any Unity environment (games, robotics, film, etc.).",
77
"dependencies": {
8-
"com.unity.barracuda": "1.4.0-preview",
8+
"com.unity.barracuda": "2.0.0-pre.3",
99
"com.unity.modules.imageconversion": "1.0.0",
1010
"com.unity.modules.jsonserialize": "1.0.0"
1111
}

docs/Integrations-Match3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ the current board size.
3838

3939
##### `public abstract int GetCellType(int row, int col)`
4040
Returns the "color" of piece at the given row and column.
41-
This should be between 0 and NumCellTypes-1 (inclusive).
41+
This should be between 0 and BoardSize.NumCellTypes-1 (inclusive).
4242
The actual order of the values doesn't matter.
4343

4444
##### `public abstract int GetSpecialType(int row, int col)`
4545
Returns the special type of the piece at the given row and column.
46-
This should be between 0 and NumSpecialTypes (inclusive).
46+
This should be between 0 and BoardSize.NumSpecialTypes (inclusive).
4747
The actual order of the values doesn't matter.
4848

4949
##### `public abstract bool IsMoveValid(Move m)`

0 commit comments

Comments
 (0)