Run the simulation (with ml agents) just in the editor and Put a breakpoint in here:
if (distanceToTarget < 0.1f)
{// Breakpoint Here
if (Target.GetComponent<TargetController>().numberOfTargetPosition!=3)
{
AddReward(1f);
}
else
{
EndEpisode();
}
//AddReward(1f);
//EndEpisode();
}
else if (this.transform.localPosition.y < 0)
{// second breakpoint here
EndEpisode();
}
With the first breakpoint Whats hapenning when the distanceToTarget < 0.1f Does it / can it ever get the reward?
With the second breakpoint is that path being triggered unnecessarily ?