Game Manager WIP
This commit is contained in:
@@ -32,6 +32,7 @@ public class AgentControllerV6 : Agent
|
||||
public int maxStepsPerCheckpoint = 300;
|
||||
public int distanceBetweenCheckpoints = 5;
|
||||
public bool ignoreMentalPain = false;
|
||||
bool isEnabled = true;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -45,11 +46,15 @@ public class AgentControllerV6 : Agent
|
||||
|
||||
protected override void OnDisable()
|
||||
{
|
||||
isEnabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
public override void OnEpisodeBegin()
|
||||
{
|
||||
if (!isEnabled)
|
||||
return;
|
||||
|
||||
stepsSinceCheckpoint = 0;
|
||||
checkpointsReached = 0;
|
||||
totalReward = 0;
|
||||
@@ -130,6 +135,9 @@ public class AgentControllerV6 : Agent
|
||||
|
||||
public override void OnActionReceived(ActionBuffers actions)
|
||||
{
|
||||
if (!isEnabled)
|
||||
return;
|
||||
|
||||
// Actions size = 2 [vertical speed, horizontal speed] = [-1..1, -1..1] // discrete = [{0, 1, 2}, {0, 1, 2}] = [{-1, 0, 1}...]
|
||||
float vInput = 0;
|
||||
float hInput = 0;
|
||||
@@ -285,6 +293,9 @@ public class AgentControllerV6 : Agent
|
||||
|
||||
public override void Heuristic(in ActionBuffers actionsOut)
|
||||
{
|
||||
if (!isEnabled)
|
||||
return;
|
||||
|
||||
var discreteActionsOut = actionsOut.DiscreteActions;
|
||||
|
||||
discreteActionsOut[0] = 2;
|
||||
|
||||
Reference in New Issue
Block a user