public void act() {

    if (state.getState().equals("idle")) {
      if(dying()) {
        Main.simulation.removeMapItem(this);
        Main.taxiService.removeTaxi(this);
      }
    }


    if (state.getState().equals("Collecting Person")) {
      if(! person.inTaxi()) {
        setLocation(route.nextPoint(speed/2));// System.out.println("blah");
        if(getLocation().equals(person.getLocation())) {
          person.pickUp();
          RouteFinder rf = new RouteFinder(Main.loader.getMask());

          route = rf.findRoute(getLocation(), person.getEndPointOnRoad());
          try { route.initialise(); } catch (Exception e) {}
          state.nextState();
        }
      }
    }



    if (state.getState().equals("Moving Person")) {
      if(getLocation().equals(route.end)) {
        person.dropOff();
        state.nextState();

        person = null;
      } else setLocation(route.nextPoint(speed/2));
    }

  }