Exemplo n.º 1
0
    def test_stop_command_has_higher_priorityj(self):
        cmd_queue = cmds.CommandPriorityQueue()
        stop_cmd = cmds.StopCmd()
        cmd_queue.put_nowait(cmds.ResumeCmd())
        cmd_queue.put_nowait(stop_cmd)
        cmd_queue.put_nowait(cmds.PauseCmd())

        received_cmd = cmd_queue.get_nowait()
        assert stop_cmd is received_cmd
Exemplo n.º 2
0
    def _train(self):
        logger.info(
            "Start session for %d iterations", self._exemplum.max_num_iterations - self._exemplum.iteration_count
        )
        try:
            self._exemplum.train()
        except Exception as e:
            logger.error("Exception during session training. Pausing...", exc_info=True)
            # FIXME: Should we use PauseCmd here? Maybe we should only know about ICommand on this level.
            self.send_command(commands.PauseCmd())

        self._update_state()
Exemplo n.º 3
0
 def pause_training(self) -> None:
     self._supervisor.send_command(commands.PauseCmd())