Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Exception in thread "Thread-1" java.lang.NullPointerException
  2. at de.nec.nle.siafu.testland.AgentModel.run(AgentModel.java:227)
  3. at java.lang.Thread.run(Thread.java:744)
  4.  
  5. public void run() {
  6. double delay = getDelay();
  7. Agent alice = getAlice();
  8.  
  9.  
  10. Place p1 = null;
  11. Place p2 = null;
  12.  
  13. try {
  14. Thread.sleep((long)(delay/2));
  15. } catch (InterruptedException e) {
  16. // TODO Auto-generated catch block
  17. e.printStackTrace();
  18. }
  19.  
  20. try {
  21. p1 = world.getNearestPlaceOfType("parking", alice.getPos());
  22. } catch (PlaceTypeUndefinedException e) {
  23. // TODO Auto-generated catch block
  24. e.printStackTrace();
  25. }
  26.  
  27. try {
  28. Thread.sleep((long)(delay/2));
  29. } catch (InterruptedException e) {
  30. // TODO Auto-generated catch block
  31. e.printStackTrace();
  32. }
  33.  
  34. try {
  35. p2 = world.getNearestPlaceOfType("parking", alice.getPos());
  36. } catch (PlaceTypeUndefinedException e) {
  37. // TODO Auto-generated catch block
  38. e.printStackTrace();
  39. }
  40. }
  41.  
  42. AgentModel agm = new AgentModel(world);
  43. Thread thr1 = new Thread(agm);
  44. thr1.start();
  45.  
  46. public AgentModel(final World world)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement