Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        //HandleInput();  // Keyboard control for debugging the arm's movement/angles
        tick++;          // Update the count of updates that have occurred
        if (tick > TICK_MAX || terminal == 1 || next_iter == true)
        {
            next_iter = true;
            return;
        }
        TCPMessage state = GetState();                         // Get the state

        server.SendMessage(state);                             // Send the state
        TCPMessage action = server.BlockingReceive();          // Wait for the chosen action from the agent
        TCPMessage reward = Execute(action);                   // Execute the action and receive reward

        server.SendMessage(reward);                            // Send reward to agent
    }