|
From: Jonathan O. <jo...@an...> - 2009-07-13 15:53:20
|
Hi Lene, A quick question. Does the line: > NdPoint point2 = space getLocation(anOtherAgent); contain a typo? There's no "dot" between space and getLocation. I'm assuming it's just a typo. Are you saying that the line: > double anOtherAgentX= point2.getX(); doesn't throw a NullPointerException but the line: > double anOtherAgentY.point2.getY(); does? Jonathan On Jul 12, 2009, at 10:19 PM, Lene Jung Kjaer wrote: > 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: ju...@si... > ______________________________________ > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge_______________________________________________ > Repast-interest mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-interest |