Modeling Agents and their Environment