예제 #1
0
		public void moveObject(Agent a, String direction) 
		{
			XYLocation presentLocation = (XYLocation) a.getAttribute(LOCATION);
			XYLocation locationToMoveTo = presentLocation.locationAt(direction);

			if (!(isBlocked(locationToMoveTo))) 
			{
				moveObjectToAbsoluteLocation(a, locationToMoveTo);
			}

		}
예제 #2
0
		public ArrayList getObjectsNear(Agent agent, int radius) 
		{
			ArrayList retval = new ArrayList();

				XYLocation agentLocation = (XYLocation) agent.getAttribute(LOCATION);

			ArrayList all = getAllObjects();
			foreach (ObjectWithDynamicAttributes a in all) 
			{
				if (!(a.Equals(agent))) 
				{
					XYLocation otherAgentLocation = (XYLocation) a
						.getAttribute(LOCATION);
					if (withinRadius(radius, agentLocation, otherAgentLocation)) 
					{
						retval.Add(a);
					}
				}
			}
			return retval;
		}
예제 #3
0
파일: Environment.cs 프로젝트: langeds/aima
		public abstract Percept getPerceptSeenBy(Agent anAgent);
예제 #4
0
파일: Environment.cs 프로젝트: langeds/aima
		public abstract void executeAction(Agent a, String act);
예제 #5
0
파일: Environment.cs 프로젝트: langeds/aima
		public void addAgent(Agent a) 
		{
			if (!(alreadyContains(a))) 
			{
				agents.Add(a);
			}
		}
예제 #6
0
파일: Environment.cs 프로젝트: langeds/aima
		public void addAgent(Agent a, string attributeName, Object attributeValue) 
		{
			if (!(alreadyContains(a))) 
			{
				a.setAttribute(attributeName, attributeValue);
				agents.Add(a);
			}
		}
예제 #7
0
파일: Environment.cs 프로젝트: langeds/aima
		public bool alreadyContains(Agent anAgent) 
		{
			bool retval = false;
			foreach (Agent agent in agents) 
			{
				//if (agent.equals(anAgent)) 
				if (agent.Equals(anAgent)) 
				{
					retval = true;
				}
			}
			return retval;
		}
예제 #8
0
		public void moveObjectToAbsoluteLocation(Agent a, XYLocation loc) 
		{

			a.setAttribute(LOCATION, loc);

		}
예제 #9
0
		public void addAgent(Agent a, XYLocation loc) 
		{
			base.addAgent(a, LOCATION, loc);
		}
예제 #10
0
		public override Percept getPerceptSeenBy(Agent anAgent) 
		{
			return new Percept();
		}
예제 #11
0
		public override void executeAction(Agent a, String Action) 
		{

		}