agents and control """set up the agent""self env=env def go(self, )"""acts for time steps""raise notimplementederror("go"abstract method the environment implements do(actionmethod where action is variablevalue dictionary this returns perceptwhich is also variable-value dictionary the use of dictionaries allows for structured actions and percepts note that environment is subclass of displayable so that it can use the display method described in section agents py -(continued from display import displayable class environment(displayable)def initial_percepts(self)"""returns the initial percepts for the agent""raise notimplementederror("initial_percepts"abstract method def do(self,action)"""does the action in the environment returns the next percept ""raise notimplementederror("do"abstract method paper buying agent and environment to run the demoin folder "aipython"load "agents py"using ipython - agents pyand copy and paste the commented-out commands at the bottom of that file this requires python with matplotlib this is an implementation of the paper buying example the environment the environment state is given in terms of the time and the amount of paper in stock it also remembers the in-stock history and the price history the percepts are the price and the amount of paper in stock the action of the agent is the number to buy here we assume that the prices are obtained from the prices list plus random integer in range [ max price addonplus linear "inflationthe agent cannot access the price modelit just observes the prices and the amount in stock agents py -(continued class tp_env(environment)version june