View Single Post
  #5 (permalink)  
Old 04-29-2008, 07:57 PM
aldo1987 aldo1987 is offline
Member
 
Join Date: Apr 2008
Posts: 2
aldo1987 is an unknown quantity at this point
public void act()
{
//ADDED ENTIRE ACT FUNCTIONALITY
if(destinations.isEmpty() == true && pickups.isEmpty() == true)
{
incrementIdleCount();
}

else
{
chooseTargetLocation();
Location target = getTargetLocation();
if(target != null) {
// Find where to move to next.
Location next = getLocation().nextLocation(target);
setLocation(next);
if(next.equals(target))
{
if(target == pickups.get(0))
{
notifyPickupArrival();
}
else if(target == destinations.get(0))
{
System.out.println(passengers.get(0));
notifyPassengerArrival(passengers.get(0));
offloadPassenger();
}


}
}

}


}

this is the method my problem appears in, The result of my println is "Passenger travelling from location 2,28 to location 18,21", in accordance with the toString method of the passenger class.
Reply With Quote