def adaptAgentObject(agent_object): """Return an object that adapts a pybrain agent to the rlglue interface. """ # This is pretty hacky: We first take a bogus agent with a bogus module # for our function adaptAgent to work, then substitue the bogus agent with # our actual agent. agent = adaptAgent(LearningAgent)(Module(1, 1)) agent.agent = agent_object return agent