def __init__(self, numTran, numStep, volume, time, frunflag): self.numSteps = numStep self.lastAction = None self.lastState = None self.env = Env.EnvCls(numTran, frunflag, volume, time) self.agent = Agent_base.Agentbase(volume, time) self.lastStep = 0 self.totalRewards = 0 self.fepisode_over = False
def __init__(self, numTran, numStep, volume, time, frunflag, parm): self.numSteps = numStep self.lastAction = None self.lastState = None self.env = Env.EnvCls(numTran, frunflag, volume, time) """Calls separate Agent modules based on different strategies""" if parm == "greedy": self.agent = Agent.AgentCls(volume, time) elif parm == "random": self.agent = Agent_rnd.AgentRand(volume, time) else: self.agent = Agent_baseline.Agentbase(volume, time) self.lastStep = 0 self.totalRewards = 0 if parm == "greedy" and frunflag == False: self.fepisode_over = False else: self.fepisode_over = True