code: private static void updateLocation(ShanksSimulation simulation,
              MobileShanksAgent agent, Double3D location) {
          agent.getCurrentLocation().setLocation3D(location);
          ContinuousPortrayal3D devicesPortrayal;
          try {
              devicesPortrayal = (ContinuousPortrayal3D) simulation
                      .getScenarioPortrayal().getPortrayals()
                      .get(Scenario3DPortrayal.MAIN_DISPLAY_ID)
                      .get(ScenarioPortrayal.DEVICES_PORTRAYAL);
              Continuous3D devicesField = (Continuous3D) devicesPortrayal
                      .getField();
              devicesField.setObjectLocation(agent, location);
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
docs: Update the location of the agent in the simulation
  
  @param simulation
  @param agent
  @param location