Benson V7 be training

This commit is contained in:
2024-04-23 15:47:36 +02:00
parent 114a65b46f
commit 85a909e4fd
34 changed files with 3423 additions and 1331 deletions

View File

@@ -66,6 +66,20 @@ public class AgentControllerV7 : Agent
transform.localRotation = startRotation;
rb.velocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;
//randomize car position
float rng = UnityEngine.Random.Range(-3f, 3f);
// int rng = UnityEngine.Random.(-3, 3);
transform.localPosition = new Vector3(
transform.localPosition.x,
transform.localPosition.y,
transform.localPosition.z + rng
);
}
public override void CollectObservations(VectorSensor sensor)
@@ -219,8 +233,7 @@ public class AgentControllerV7 : Agent
if (checkpintDistance < 0.1f)
{
stepsSinceCheckpoint = 0;
checkpointsReached += 1;
// If last checkpoint
if (checkpointsReached == checkpoints.Count - 1)
{
@@ -228,6 +241,8 @@ public class AgentControllerV7 : Agent
EndEpisode();
}
checkpointsReached += 1;
//TODO fix variable names
AddReward(1f);