Example #1
0
 public void init(Simulator aSim, XMLParser aSpeciesRoot, XMLParser speciesDefaults) {
   super.init(aSim, aSpeciesRoot, speciesDefaults);
   /*
    * Retrieving list of environments to which this species is sensitive
    * to and the correspondent probability of dying if under the
    * influence of that environment.
    */
   String s;
   Double p;
   for (Element aSpeciesMarkUp : aSpeciesRoot.getChildrenElements("envSensitivity")) {
     s = aSpeciesMarkUp.getAttributeValue("name");
     envSensitivity.add(s);
     p = aSpeciesRoot.getDblAttrOfChildSuchAttribute("envSensitivity", "name", s, "probDie");
     envProbDie.put(s, p);
   }
 }
Example #2
0
  public void initFromProtocolFile(Simulator aSim, XMLParser xmlMarkUp) {
    // Initilaisation of the Located agent
    // super.initFromProtocolFile(aSimulator, aSpeciesRoot);
    // init();
    _nCopy = getSpeciesParam().nCopy;
    int reacIndex;

    reactionActive = new ArrayList<Integer>();

    for (Element aReactionMarkUp : xmlMarkUp.getChildrenElements("reaction")) {
      reacIndex = aSim.getReactionIndex(aReactionMarkUp.getAttributeValue("name"));
      /*
       * Add the reaction to the list of active reactions.
       */
      if (aReactionMarkUp.getAttributeValue("status").equals("active"))
        reactionActive.add(reacIndex);
    }
  }