# What is an Environment? - Artificial Intelligence

We can think of the environment as being everything that surrounds the agent, but which is distinct from the agent and its behaviour. An environment is everything in the world that surrounds the agent that is not part of the agent itself. This is where the agent ‘lives’ or operates, and provides the agent with something to sense and somewhere for it to move around. An environment is analogous to the world in real life having some of its properties.

An environment is not the same as the term ‘ecological niche’ which is used to describe how an organism or population responds to the distribution of resources and competitors and depends not only on where the organism lives and what surrounds it but also on what it does. Odum uses the analogy that the habitat of an organism is its ‘address’ or location, whereas the niche is its ‘profession’.

For example, an oak tree might have oak woodlands as its habitat – the address might be “Oak Tree, New Forest” whereas what the oak tree does, and how it makes a living, by responding to distribution of resources and competitors, is its niche.

We will prefer to use the term ‘environment’ instead, as this more closely matches concepts that are familiar in computer science (such as the term ‘virtual environment’ – see below). In addition, the distinction between an agent and its ecological niche is related to its behaviour, with the two being intertwined – that is, the niche within which an agent is found dictates it’s behaviour, and it’s behavior to some extent determines its niche.

On the other hand, an environment is clearly distinguishable from the agent as being everything in the immediate world or habitat of the agent that is not part of the agent itself. We also would like to adopt a first-person design perspective, to describe the behaviour of the agent directly based on the point of view of the agent itself, as opposed to a third-person perspective of an observer. In other words, we wish to design behaviour as a function of the agent alone as it interacts with its environment (which might include other agents), rather than have to design it in relation to its niche. An environment can have various attributes from the point of view of the agent.

Attributes of environments (based on Wikipedia entry for ‘Intelligent Agents’

The analogy of an environment being like the world we live in is often implicitly used when the term ‘environment’ is used in computer science and AI in particular. An agent can explore, get lost in, and map a virtual computer environment just the same as a human in the real world environment – the ability to observe/sense and move around the environment are key properties of both.

However, virtual computer environments do not have to be limited to a geographical interpretation where physical location is associated with a specific position in the environment. The physics of the virtual environment can be altered to suit the designer’s purposes. For example, it is possible for an avatar (the computer-generated agent that represents the human operator) to fly around in virtual environments such as Second Life, and in some computer games, avatars and bots are able to teleport, both of which are impossible for humans in real life. Alternatively, the environment might be a representation of something that may not be easily or conveniently represented geographically such as a computer network, the Internet or even the London Underground network. The environment may also be a simulation of a real environment, where the goal is to simulate specifically chosen real physical properties as closely as possible. A problem with simulated environments, however, is that it is often difficult to achieve realism in the simulation, as the simulation may diverge from reality in unpredictable ways.