Skip to content

Commit

Permalink
edit to no random action for experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
colourfulspring committed Feb 25, 2024
1 parent d0a09f2 commit c3ff828
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CarAgent : Agent
// to this range
public int decisionRangeRadius;

private NavMeshAgent m_AgentNavMeshAgent; //cached on initialization
private NavMeshAgent m_AgentNavMeshAgent; //cached on initialization

public bool isRunning;

Expand Down Expand Up @@ -178,6 +178,7 @@ public Vector2 ReverselyNormalizePos2dPolar(Vector2 pos)
{
radius = hit.distance;
}

// non-normalized radius
radius = normalizedRadius * radius;

Expand Down Expand Up @@ -210,16 +211,17 @@ public override void Heuristic(in ActionBuffers actionsOut)
// discreteActionsOut[0] = 2;
// }
var continuousActionsOut = actionsOut.ContinuousActions;
// continuousActionsOut[0] = 0f;
// continuousActionsOut[1] = 0f;
continuousActionsOut[0] = Random.Range(-1f,1f);
continuousActionsOut[1] = Random.Range(-1f, 1f);
continuousActionsOut[0] = 0f;
continuousActionsOut[1] = 0f;
// continuousActionsOut[0] = Random.Range(-1f, 1f);
// continuousActionsOut[1] = Random.Range(-1f, 1f);
}

public void FixedUpdate()
{
Debug.Log(this.transform.parent.gameObject.name +
", " + this.name + " FixedUpdate: " + carCatchingEnvController.ResetTimer + " " + transform.position);
", " + this.name + " FixedUpdate: " + carCatchingEnvController.ResetTimer + " " +
transform.position);

// Debug.Log( this.transform.parent.gameObject.name +
// ", " + this.name + " StepCount: " + StepCount);
Expand Down

0 comments on commit c3ff828

Please sign in to comment.