- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.4k
Removing Obsolete methods from the package #5024
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
                    Changes from 1 commit
      Commits
    
    
            Show all changes
          
          
            7 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      b51f827
              
                Removing Obsolete methods from the package
              
              
                vincentpierre 911696e
              
                Missing depecration and modified changelog
              
              
                vincentpierre 3ace30a
              
                Readding the obsolete BrainParameter methods, will need a larger disc…
              
              
                vincentpierre 7d9eb6d
              
                Removing Action Masker, readding the warining when using a non-implem…
              
              
                vincentpierre 5fc2748
              
                Merge branch 'v2-staging' into v-staging-remove-obsolete
              
              
                vincentpierre b8001c6
              
                removing documentation and some calls to deprecated methods in the ex…
              
              
                vincentpierre 47c4489
              
                Editing the Changelog to put the unreleased on top
              
              
                vincentpierre File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -338,17 +338,6 @@ internal struct AgentParameters | |
| /// </summary> | ||
| IActuator m_VectorActuator; | ||
|  | ||
| /// <summary> | ||
| /// This is used to avoid allocation of a float array every frame if users are still using the old | ||
| /// OnActionReceived method. | ||
| /// </summary> | ||
| float[] m_LegacyActionCache; | ||
|  | ||
| /// <summary> | ||
| /// This is used to avoid allocation of a float array during legacy calls to Heuristic. | ||
| /// </summary> | ||
| float[] m_LegacyHeuristicCache; | ||
|  | ||
| /// Currect MultiAgentGroup ID. Default to 0 (meaning no group) | ||
| int m_GroupId; | ||
|  | ||
|  | @@ -952,29 +941,7 @@ public virtual void Initialize() { } | |
| /// <seealso cref="IActionReceiver.OnActionReceived"/> | ||
| public virtual void Heuristic(in ActionBuffers actionsOut) | ||
| { | ||
| // Disable deprecation warnings so we can call the legacy overload. | ||
|         
                  chriselion marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| #pragma warning disable CS0618 | ||
|  | ||
| // The default implementation of Heuristic calls the | ||
| // obsolete version for backward compatibility | ||
| switch (m_PolicyFactory.BrainParameters.VectorActionSpaceType) | ||
| { | ||
| case SpaceType.Continuous: | ||
| Heuristic(m_LegacyHeuristicCache); | ||
| Array.Copy(m_LegacyHeuristicCache, actionsOut.ContinuousActions.Array, m_LegacyActionCache.Length); | ||
| actionsOut.DiscreteActions.Clear(); | ||
| break; | ||
| case SpaceType.Discrete: | ||
| Heuristic(m_LegacyHeuristicCache); | ||
| var discreteActionSegment = actionsOut.DiscreteActions; | ||
| for (var i = 0; i < actionsOut.DiscreteActions.Length; i++) | ||
| { | ||
| discreteActionSegment[i] = (int)m_LegacyHeuristicCache[i]; | ||
| } | ||
| actionsOut.ContinuousActions.Clear(); | ||
| break; | ||
| } | ||
| #pragma warning restore CS0618 | ||
| } | ||
|  | ||
| /// <summary> | ||
|  | @@ -1064,8 +1031,6 @@ void InitializeActuators() | |
| var param = m_PolicyFactory.BrainParameters; | ||
| m_VectorActuator = new AgentVectorActuator(this, this, param.ActionSpec); | ||
| m_ActuatorManager = new ActuatorManager(attachedActuators.Length + 1); | ||
| m_LegacyActionCache = new float[m_VectorActuator.TotalNumberOfActions()]; | ||
| m_LegacyHeuristicCache = new float[m_VectorActuator.TotalNumberOfActions()]; | ||
|  | ||
| m_ActuatorManager.Add(m_VectorActuator); | ||
|  | ||
|  | @@ -1229,10 +1194,6 @@ public virtual void WriteDiscreteActionMask(IDiscreteActionMask actionMask) | |
| { | ||
| m_ActionMasker = new DiscreteActionMasker(actionMask); | ||
| } | ||
| // Disable deprecation warnings so we can call the legacy overload. | ||
|         
                  chriselion marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| #pragma warning disable CS0618 | ||
| CollectDiscreteActionMasks(m_ActionMasker); | ||
| #pragma warning restore CS0618 | ||
| } | ||
|  | ||
| /// <summary> | ||
|  | @@ -1310,24 +1271,6 @@ public virtual void OnActionReceived(ActionBuffers actions) | |
| // Nothing implemented. | ||
| return; | ||
| } | ||
|  | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OnActionReceived should be empty now (no reason to look at the actionSpec) | ||
| if (!actions.ContinuousActions.IsEmpty()) | ||
| { | ||
| Array.Copy(actions.ContinuousActions.Array, | ||
| m_LegacyActionCache, | ||
| actionSpec.NumContinuousActions); | ||
| } | ||
| else | ||
| { | ||
| for (var i = 0; i < m_LegacyActionCache.Length; i++) | ||
| { | ||
| m_LegacyActionCache[i] = (float)actions.DiscreteActions[i]; | ||
| } | ||
| } | ||
| // Disable deprecation warnings so we can call the legacy overload. | ||
| #pragma warning disable CS0618 | ||
| OnActionReceived(m_LegacyActionCache); | ||
| #pragma warning restore CS0618 | ||
| } | ||
|  | ||
| /// <summary> | ||
|  | ||
This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be abstract (with no implementation).