Skip to content

Made BehaviorType public and added the SetBehaviorType method #3572

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

Merged
merged 2 commits into from
Mar 5, 2020

Conversation

vincentpierre
Copy link
Contributor

Proposed change(s)

Made BehaviorType public and added the SetBehaviorType method

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

@vincentpierre vincentpierre self-assigned this Mar 5, 2020
[Serializable]
public enum BehaviorType
{
Default,
Copy link
Contributor

Choose a reason for hiding this comment

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

Doc strings?

@@ -363,6 +363,24 @@ void NotifyAgentDone(DoneReason doneReason)
m_Brain = m_PolicyFactory.GeneratePolicy(Heuristic);
}

/// <summary>
/// Updates the type of behavior for the agent.
/// - Default : The Agent will use the remote process for decision making.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say move these to the enum's comments

public void SetBehaviorType(BehaviorType behaviorType)
{
m_PolicyFactory.m_BehaviorType = behaviorType;
m_Brain?.Dispose();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we only do this if the old and new types are different?

@vincentpierre vincentpierre merged commit 29ee576 into master Mar 5, 2020
@delete-merged-branch delete-merged-branch bot deleted the develop-behavior-type-programatically branch March 5, 2020 20:12
@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