Environment, Cognition, and Action: An Integrated Approach