def train(self, maxtimesteps=None, maxseconds=None, save_freq=None):
    assert ((maxtimesteps is not None) or (maxseconds is not None))
    start_time = time.time()
    while True:
        if ((maxtimesteps is not None) and (self.t >= maxtimesteps)):
            break
        if ((maxseconds is not None) and ((time.time() - start_time) >= maxtimesteps)):
            break
        t = self.t
        self.step()
        if (save_freq and ((t // save_freq) != (self.t // save_freq))):
            self.save()
    self.save()
def train(self, maxtimesteps=None, maxseconds=None, save_freq=None):
    assert ((maxtimesteps is not None) or (maxseconds is not None))
    start_time = time.time()
    while True:
        if ((maxtimesteps is not None) and (self.t >= maxtimesteps)):
            break
        if ((maxseconds is not None) and ((time.time() - start_time) >= maxtimesteps)):
            break
        t = self.t
        self.step()
        if (save_freq and ((t // save_freq) != (self.t // save_freq))):
            self.save()
    self.save()