Ejemplo n.º 1
0
  /**
   * Called to free resources used by the simulation. This method is called just before the
   * simulation is removed.
   */
  public void removed() {
    /* Remove radio medium */
    if (currentRadioMedium != null) {
      currentRadioMedium.removed();
    }

    /* Remove all motes */
    Mote[] motes = getMotes();
    for (Mote m : motes) {
      removeMote(m);
    }
  }
Ejemplo n.º 2
0
  /**
   * Remove given mote type from simulation.
   *
   * @param type Mote type
   */
  public void removeMoteType(MoteType type) {
    if (!moteTypes.contains(type)) {
      logger.fatal("Mote type is not registered: " + type);
      return;
    }

    /* Remove motes */
    for (Mote m : getMotes()) {
      if (m.getType() == type) {
        removeMote(m);
      }
    }

    moteTypes.remove(type);
    this.setChanged();
    this.notifyObservers(this);
  }