Ejemplo n.º 1
0
  /*...............................................................................................................*/
  int numSites(int it) {
    CharacterState cs = null;
    if (observedStates == null) return 0;
    int count = 0;
    for (int ic = 0; ic < observedStates.getNumChars(); ic++) {
      cs = observedStates.getCharacterState(cs, ic, it);
      if (cs == null) return 0;
      if (!cs.isInapplicable() && !cs.isUnassigned()) count++;
    }

    return count;
  } /*...............................................................................................................*/
Ejemplo n.º 2
0
 boolean hasData(int it) {
   CharacterState cs = null;
   try {
     for (int ic = 0; ic < observedStates.getNumChars(); ic++) {
       cs = observedStates.getCharacterState(cs, ic, it);
       if (cs == null) return false;
       if (!cs.isInapplicable() && !cs.isUnassigned()) return true;
     }
   } catch (NullPointerException e) {
   }
   return false;
 }
Ejemplo n.º 3
0
  /*...............................................................................................................*/
  int sequenceLength(int it) {
    CharacterState cs = null;
    if (observedStates == null) return 0;
    int count = 0;
    for (int ic = 0; ic < observedStates.getNumChars(); ic++) {
      cs = observedStates.getCharacterState(cs, ic, it);
      if (cs == null) return 0;
      if (cs instanceof MolecularState) {
        if (!cs.isInapplicable()) // if Molecular, then count missing & with state
        count++;
      } else if (!cs.isInapplicable()
          && !cs.isUnassigned()) // if Molecular, then count missing & with state
      count++;
    }

    return count;
  }