Skip to content

Commit 4fc3039

Browse files
authored
Update AgentDependentDeicision.md
1 parent 00878b4 commit 4fc3039

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
# AgentDependentDeicision
2+
3+
If you want to use your own policy on a specific agent instead of using the Brain when using `TrainerPPO` or `TrainerMimic`, here is the way.
4+
5+
Implement the abstract class called AgentDependentDecision. You only need to implement one abstract method:
6+
```csharp
7+
/// <summary>
8+
/// Implement this method for your own ai decision.
9+
/// </summary>
10+
/// <param name="vectorObs">vector observations</param>
11+
/// <param name="visualObs">visual observations</param>
12+
/// <param name="heuristicAction">The default action from brain if you are not using the decision</param>
13+
/// <param name="heuristicVariance">The default action variance from brain if you are not using the decision.
14+
/// It might be null if discrete aciton space is used or the Model does not support variance.</param>
15+
/// <returns>the actions</returns>
16+
public abstract float[] Decide(List<float> vectorObs, List<Texture2D> visualObs, List<float> heuristicAction, List<float> heuristicVariance = null);
17+
```
18+
19+
Then, attach your new script to the agent you want to use your policy, and check the `useDecision` in inspector.
20+
21+
Note that your policy is only used under certain training setting when using `TrainerPPO` or `TrainerMimic`. See [Training with Proximal Policy Optimization(PPO)](Training-PPO.md) and [Training with Imitation(Supervised Learning)](Training-SupervisedLearning.md) for more details.

0 commit comments

Comments
 (0)