Example #1
0
  /**
   * \brief Update the radius of the agent from the current mass (and then the volume) of the agent
   * (EPS included)
   *
   * <p>Update the radius of the agent from the current mass (and then the volume) of the agent (EPS
   * included)
   */
  public void updateSize() {
    // Update the totalMass field (sum of the particles masses)
    updateMass();

    if (_totalMass < 0)
      LogFile.writeLog("Warning: negative mass on agent " + _family + ", " + _genealogy);

    // Sum of (particles masses / particles density)
    updateVolume();

    // Compute radius according to the volume
    updateRadius();

    // sonia:chemostat
    if (Simulator.isChemostat) {
      // don't do the update of attachment/detachment

    } else {

      // Check if by chance the agent is close enough to a support to be
      // attached

      updateAttachment();
    }
  }