gt:         scheduleFirst(dest, delay, tag, null);
context: /*
   * Title:        CloudSim Toolkit
   * Description:  CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds
   * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
   *
   * Copyright (c) 2009-2012, The University of Melbourne, Australia
   */
  package org.cloudbus.cloudsim.core;
  
  import org.cloudbus.cloudsim.Log;
  import org.cloudbus.cloudsim.network.NetworkTopology;
  import org.cloudbus.cloudsim.core.predicates.Predicate;
  
  /**
   * This class represents a simulation entity. An entity handles events and can
   * send events to other entities.
   *
   * @author Marcos Dias de Assuncao
   * @since CloudSim Toolkit 1.0
   */
  public abstract class SimEntity implements Cloneable, Nameable {
  
      /**
       * The entity name.
       */
      private String name;
  
      /**
       * The entity id.
       */
      private int id;
  
      /**
       * The buffer for selected incoming events.
       */
      private SimEvent buffer;
  
      /**
       * The entity's current state.
       */
      private int state;
  
      /**
       * Creates a new entity.
       *
       * @param name the name to be associated with the entity
       * @throws IllegalArgumentException when the entity name is invalid
       */
      public SimEntity(String name) {
          if (name.contains(" ")) {
              throw new IllegalArgumentException("Entity names can't contain spaces.");
          }
          this.name = name;
          id = -1;
          state = RUNNABLE;
          CloudSim.addEntity(this);
      }
  
      /**
       * Gets the name of this entity.
       *
       * @return The entity's name
       */
      @Override
      public String getName() {
          return name;
      }
  
      /**
       * Gets the unique id number assigned to this entity.
       *
       * @return The id number
       */
      @Override
      public int getId() {
          return id;
      }
  
      // The schedule functions
      /**
       * Sends an event to another entity by id number, with data. Note that the
       * tag <code>9999</code> is reserved.
       *
       * @param dest The unique id number of the destination entity
       * @param delay How many seconds after the current simulation time the event should be sent
       * @param tag An user-defined number representing the type of event.
       * @param data The data to be sent with the event.
       */
      public void schedule(int dest, double delay, int tag, Object data) {
          if (!CloudSim.running()) {
              return;
          }
          CloudSim.send(id, dest, delay, tag, data);
      }
  
      /**
       * Sends an event to another entity by id number and with <b>no</b> data.
       * Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The unique id number of the destination entity
       * @param delay How many seconds after the current simulation time the event should be sent
       * @param tag An user-defined number representing the type of event.
       */
      public void schedule(int dest, double delay, int tag) {
          schedule(dest, delay, tag, null);
      }
  
      /**
       * Sends an event to another entity through a port with a given name, with
       * data. Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The name of the port to send the event through
       * @param delay How many seconds after the current simulation time the event should be sent
       * @param tag An user-defined number representing the type of event.
       * @param data The data to be sent with the event.
       */
      public void schedule(String dest, double delay, int tag, Object data) {
          schedule(CloudSim.getEntityId(dest), delay, tag, data);
      }
  
      /**
       * Sends an event to another entity through a port with a given name, with
       * <b>no</b> data. Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The name of the port to send the event through
       * @param delay How many seconds after the current simulation time the event should be sent
       * @param tag An user-defined number representing the type of event.
       */
      public void schedule(String dest, double delay, int tag) {
          schedule(dest, delay, tag, null);
      }
  
      /**
       * Sends an event to another entity by id number, with data but no delay.
       * Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The unique id number of the destination entity
       * @param tag An user-defined number representing the type of event.
       * @param data The data to be sent with the event.
       */
      public void scheduleNow(int dest, int tag, Object data) {
          schedule(dest, 0, tag, data);
      }
  
      /**
       * Sends an event to another entity by id number and with <b>no</b> data and
       * no delay. Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The unique id number of the destination entity
       * @param tag An user-defined number representing the type of event.
       */
      public void scheduleNow(int dest, int tag) {
          schedule(dest, 0, tag, null);
      }
  
      /**
       * Sends an event to another entity through a port with a given name, with
       * data but no delay. Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The name of the port to send the event through
       * @param tag An user-defined number representing the type of event.
       * @param data The data to be sent with the event.
       */
      public void scheduleNow(String dest, int tag, Object data) {
          schedule(CloudSim.getEntityId(dest), 0, tag, data);
      }
  
      /**
       * Send an event to another entity through a port with a given name, with
       * <b>no</b> data and no delay. Note that the tag <code>9999</code> is
       * reserved.
       *
       * @param dest The name of the port to send the event through
       * @param tag An user-defined number representing the type of event.
       */
      public void scheduleNow(String dest, int tag) {
          schedule(dest, 0, tag, null);
      }
  
      /**
       * Sends a high priority event to another entity by id number, with data.
       * Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The unique id number of the destination entity
       * @param delay How many seconds after the current simulation time the event should be sent
       * @param tag An user-defined number representing the type of event.
       * @param data The data to be sent with the event.
       */
      public void scheduleFirst(int dest, double delay, int tag, Object data) {
          if (!CloudSim.running()) {
              return;
          }
          CloudSim.sendFirst(id, dest, delay, tag, data);
      }
  
      /**
       * Sends a high priority event to another entity by id number and with
       * <b>no</b> data. Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The unique id number of the destination entity
       * @param delay How many seconds after the current simulation time the event should be sent
       * @param tag An user-defined number representing the type of event.
       */
      public void scheduleFirst(int dest, double delay, int tag) {
          scheduleFirst(dest, delay, tag, null);
      }
  
      /**
       * Sends a high priority event to another entity through a port with a given
       * name, with data. Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The name of the port to send the event through
       * @param delay How many seconds after the current simulation time the event should be sent
       * @param tag An user-defined number representing the type of event.
       * @param data The data to be sent with the event.
       */
      public void scheduleFirst(String dest, double delay, int tag, Object data) {
          scheduleFirst(CloudSim.getEntityId(dest), delay, tag, data);
      }
  
      /**
       * Sends a high priority event to another entity through a port with a given
       * name, with <b>no</b>
       * data. Note that the tag <code>9999</code> is reserved.
       *
       * @param dest The name of the port to send the event through
       * @param delay How many seconds after the current simulation time the event should be sent
       * @param tag An user-defined number representing the type of event.
       */
      public void scheduleFirst(String dest, double delay, int tag) {
  