//Give the Qtable your current state. Get the best action. public void SelectAnAction() { string bestAction = qTableScript.GetBestAction(currentStateString); if (EpsilonRandomNess() == true) { bestAction = RandomOtherAction(bestAction); } switch (bestAction) { case "N": TurnRobby(0); myAction = "N"; StartCoroutine(MoveAndWait(0, 1)); break; case "S": TurnRobby(180); myAction = "S"; StartCoroutine(MoveAndWait(0, -1)); break; case "E": TurnRobby(90); myAction = "E"; StartCoroutine(MoveAndWait(1, 0)); break; case "W": TurnRobby(270); myAction = "W"; StartCoroutine(MoveAndWait(-1, 0)); break; case "P": myAnim.SetTrigger("Pickup"); myAction = "P"; StartCoroutine(PickUpAndWait()); break; default: //Debug.Log("BEST ACTION NOT UNDERSTOOD"); return; } }