added agentlist() and agentcount() functions to Terrain class.