Manually switch behavior type

I need change behavior type of my Agent when episode is end. Because my agent have rigibodies and relies on physics, resetting position with failing cause bad results when i agent trying to reset at start position, because at this time he tries to move ( he got NN attached).
So it is possible to change with code BehaviorType of my Agent to heuristic and back to NN?
I found that this not working

GetComponent<Unity.MLAgents.Policies.BehaviorParameters>().BehaviorType=1

and this didnt find component “Behavior parameter”:

GetComponent<BehaviorParameters>().BehaviorType = 1;

How to access it manually? I need to turn off NN, replace my agent without any rigidbody/physics troubles and turn NN on again.

you can make the rigidbody kinematic, move it, then switch it back to dynamic