Source code for agents.random_agent

from random import choice

from gameai.core import Agent


[docs]class RandomAgent(Agent): ''' Implementation of a random agent, which simply selects a random action from the current action space each turn ''' def action(self, g, s, _): return choice(g.action_space(s))