|
From: Lene J. K. <ju...@si...> - 2009-07-13 03:19:16
|
I wrote earlier today regarding an agent accessing an other agent's x and y coordinates in a method. I need to calculate the vector distance from one agents location to another agents location. I have tried: ..... NdPoint point = space.getLocation(this); double oneAgentX = point.getX(); double oneAgentY = point.getY(); NdPoint point2 = space getLocation(anOtherAgent); double anOtherAgentX= point2.getX(); double anOtherAgentY.point2.getY(); .... this one throws a java.lang.NullPointerException. I've also tried to just use getter methods for x and y: anOtherAgentX = anOtherAgent.getX(); anOtherAgentY = anOtherAgent.getY(); again, I get a java.lang.NullPointerException. or anOtherAgentX = anOtherAgent.x; anOtherAgentY = anOtherAgent.y; still no luck Does anyone know what I'm doing wrong?? Please, I could really use your help. Thanks, Lene ______________________________________ Lene Jung Kjær, PhD. Candidate Cooperative Wildlife Research Laboratory Southern Illinois University Life Science II, Room 269B Carbondale, Il 62901 Phone office: 618-453-5495 Fax office: 618-453-6944 Phone home: 618-303-6136 Email: <mailto:ju...@si...> ju...@si... ______________________________________ |