protected void restoreState(){
  ArrayList<Node> tmp=storedNodes;
  storedNodes=nodes;
  nodes=tmp;
  root=nodes.get(storedRootNumber);
  nodeCount=storedNodeCount;
  internalNodeCount=storedInternalNodeCount;
  if (addedParameters != null) {
    if (addedParameters.length == 5) {
      removeVariable(addedParameters[0]);
      removeVariable(addedParameters[1]);
      removeVariable(addedParameters[2]);
      removeVariable(addedParameters[3]);
      storedInternalNodeHeights.removeParameter(addedParameters[0]);
      storedInternalNodeHeights.removeParameter(addedParameters[4]);
      storedInternalAndRootNodeHeights.removeParameter(addedParameters[0]);
      storedInternalAndRootNodeHeights.removeParameter(addedParameters[1]);
      storedNodeRates.removeParameter(addedParameters[2]);
    }
 else {
      storedInternalNodeHeights.removeParameter(addedParameters[0]);
      storedInternalNodeHeights.removeParameter(addedParameters[1]);
      removeVariable(addedParameters[0]);
      removeVariable(addedParameters[1]);
      storedInternalAndRootNodeHeights.removeParameter(addedParameters[0]);
      storedInternalAndRootNodeHeights.removeParameter(addedParameters[1]);
      removeVariable(addedParameters[2]);
      removeVariable(addedParameters[3]);
      storedNodeRates.removeParameter(addedParameters[2]);
    }
  }
  if (addedPartitioningParameter != null) {
    partitioningParameters.removeParameter(addedPartitioningParameter);
    removeVariable(addedPartitioningParameter);
  }
  if (removedParameters != null) {
    storedInternalNodeHeights.addParameter(removedParameters[0]);
    storedInternalNodeHeights.addParameter(removedParameters[1]);
    addVariable(removedParameters[0]);
    addVariable(removedParameters[1]);
    storedInternalAndRootNodeHeights.addParameter(removedParameters[0]);
    storedInternalAndRootNodeHeights.addParameter(removedParameters[1]);
    addVariable(removedParameters[2]);
    addVariable(removedParameters[3]);
    storedNodeRates.addParameter(removedParameters[2]);
  }
  if (removedPartitioningParameter != null) {
    partitioningParameters.addParameter(removedPartitioningParameter);
    addVariable(removedPartitioningParameter);
  }
  nullCounter=storedNullCounter;
}

protected void restoreState ( ) { ArrayList < Node > tmp = storedNodes ; storedNodes = nodes ; nodes = tmp ; root = nodes . get ( storedRootNumber ) ; nodeCount = storedNodeCount ; internalNodeCount = storedInternalNodeCount ; if ( addedParameters != null ) { if ( addedParameters . length == 5 ) { removeVariable ( addedParameters [ 0 ] ) ; removeVariable ( addedParameters [ 1 ] ) ; removeVariable ( addedParameters [ 2 ] ) ; removeVariable ( addedParameters [ 3 ] ) ; storedInternalNodeHeights . removeParameter ( addedParameters [ 0 ] ) ; storedInternalNodeHeights . removeParameter ( addedParameters [ 4 ] ) ; storedInternalAndRootNodeHeights . removeParameter ( addedParameters [ 0 ] ) ; storedInternalAndRootNodeHeights . removeParameter ( addedParameters [ 1 ] ) ; storedNodeRates . removeParameter ( addedParameters [ 2 ] ) ; } else { storedInternalNodeHeights . removeParameter ( addedParameters [ 0 ] ) ; storedInternalNodeHeights . removeParameter ( addedParameters [ 1 ] ) ; removeVariable ( addedParameters [ 0 ] ) ; removeVariable ( addedParameters [ 1 ] ) ; storedInternalAndRootNodeHeights . removeParameter ( addedParameters [ 0 ] ) ; storedInternalAndRootNodeHeights . removeParameter ( addedParameters [ 1 ] ) ; removeVariable ( addedParameters [ 2 ] ) ; removeVariable ( addedParameters [ 3 ] ) ; storedNodeRates . removeParameter ( addedParameters [ 2 ] ) ; } } if ( addedPartitioningParameter != null ) { partitioningParameters . removeParameter ( addedPartitioningParameter ) ; removeVariable ( addedPartitioningParameter ) ; } if ( removedParameters != null ) { storedInternalNodeHeights . addParameter ( removedParameters [ 0 ] ) ; storedInternalNodeHeights . addParameter ( removedParameters [ 1 ] ) ; addVariable ( removedParameters [ 0 ] ) ; addVariable ( removedParameters [ 1 ] ) ; storedInternalAndRootNodeHeights . addParameter ( removedParameters [ 0 ] ) ; storedInternalAndRootNodeHeights . addParameter ( removedParameters [ 1 ] ) ; addVariable ( removedParameters [ 2 ] ) ; addVariable ( removedParameters [ 3 ] ) ; storedNodeRates . addParameter ( removedParameters [ 2 ] ) ; } if ( removedPartitioningParameter != null ) { partitioningParameters . addParameter ( removedPartitioningParameter ) ; addVariable ( removedPartitioningParameter ) ; } nullCounter = storedNullCounter ; }
restore the stored state
