Skip to content

Commit

Permalink
increase replicability of SimpleRandomTree
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Aug 14, 2016
1 parent dc7879c commit c7914f2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/beast/evolution/tree/SimpleRandomTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void doTheWork() {
for (final MRCAPrior prior : calibrations) {
final TaxonSet taxonSet = prior.taxonsetInput.get();
if (taxonSet != null && !prior.onlyUseTipsInput.get()) {
final Set<String> bTaxa = new HashSet<>();
final Set<String> bTaxa = new LinkedHashSet<>();
if (taxonSet.asStringList() == null) {
taxonSet.initAndValidate();
}
Expand Down Expand Up @@ -219,7 +219,7 @@ public void doTheWork() {
for (int i = 0; i < lastMonophyletic; i++) {
for (int j = i + 1; j < lastMonophyletic; j++) {

Set<String> intersection = new HashSet<>(taxonSets.get(i));
Set<String> intersection = new LinkedHashSet<>(taxonSets.get(i));
intersection.retainAll(taxonSets.get(j));

if (intersection.size() > 0) {
Expand Down Expand Up @@ -283,7 +283,7 @@ public void doTheWork() {
try {
succ = setHeights(rate, false, epsi);
} catch (ConstraintViolatedException e) {
throw new RuntimeException("Contraint failed: " + e.getMessage());
throw new RuntimeException("Constraint failed: " + e.getMessage());
}
--ntries;
rate *= 2;
Expand All @@ -292,7 +292,7 @@ public void doTheWork() {
try {
succ = setHeights(rate, true, 0);
} catch (ConstraintViolatedException e) {
throw new RuntimeException("Contraint failed: " + e.getMessage());
throw new RuntimeException("Constraint failed: " + e.getMessage());
}
}
assert succ;
Expand Down Expand Up @@ -355,7 +355,7 @@ public void buildTree(final Set<String> taxa) {

nextNodeNr = nrOfTaxa;

final Set<Node> candidates = new HashSet<>();
final Set<Node> candidates = new LinkedHashSet<>();
int nr = 0;
for (String taxon : taxa) {
final Node node = new Node();
Expand Down Expand Up @@ -410,7 +410,7 @@ private Node buildTree(final int monoCladeIndex, final Set<Node> candidates, fin
// build all subtrees
for (final int iMonoNode : children[monoCladeIndex]) {
// create list of leaf nodes for this monophyletic MRCA
final Set<Node> candidates2 = new HashSet<>();
final Set<Node> candidates2 = new LinkedHashSet<>();
final Set<String> bTaxonSet = taxonSets.get(iMonoNode);
for (String taxon : bTaxonSet) {
candidates2.add(allCandidates.get(taxon));
Expand Down

0 comments on commit c7914f2

Please sign in to comment.