Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split and improve side channel / LL-API documentation #3574

Merged
merged 9 commits into from
Mar 9, 2020

Conversation

awjuliani
Copy link
Contributor

@awjuliani awjuliani commented Mar 5, 2020

Proposed change(s)

  • Splits the Python LL-API and side channel documentation into separate pages.
  • Minor improvements to clarity on side channel and LL-API documentation.
  • Fixes small bugs in side channel example code in docs.

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

@@ -0,0 +1,190 @@
# Custom Side Channels

You can create your own side channel in C# and Python and use it to communicate custom data structures between the two. This can be useful for situations in which the information to be sent is too complex or structured for the built-in `FloatPropertiesChannel`, or too one-off to be appropriate as an agent observation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you can say information is "too structured" or "too one-off".

}
```

Once we have defined our custom side channel class, we need to ensure that it is instantiated and registered. This can typically be done wherever the logic of the side channel makes sense to be associated, for example on a monobehavior object that might need to access data from the side channel. Here we show a simple MonoBehavior object which instantiates and registeres the new side channel. If you have not done it already, make sure that the monobehavior which registers the side channel is connected to a gameobject which will be live in your Unity scene.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should split the lines that are too long.
monobehavior --> MonoBehaviour

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connected --> attached

// When a Debug.Log message is created, we send it to the stringChannel
Application.logMessageReceived += stringChannel.SendDebugStatementToPython;

// Just in case the Academy has not yet initialized
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this comment means, this is the only way to register the side channel on C#

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha. You wrote it :) Happy to remove/change.

docs/Python-API.md Outdated Show resolved Hide resolved
Now, if you run this script and press `Play` the Unity Editor when prompted, The console in the Unity Editor will
display a message at every Python step. Additionally, if you press the Space Bar in the Unity Engine, a message will
appear in the terminal.
For information on how to make custom side channels for sending additional data types, see the documentation [here](Custom-SideChannels.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead link. I think ../Custom-SideChannels.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is weird. They all seem to work for me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right my bad, if the markdown check says yes then yes

awjuliani and others added 3 commits March 5, 2020 13:46
@awjuliani awjuliani merged commit 433a270 into master Mar 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the develop-sidechannel-docs branch March 9, 2020 19:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants