Skip to content

Commit

Permalink
make Alignment a StateNode -- needs testing #1150
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed May 16, 2024
1 parent 111d399 commit 8065aa2
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 6 deletions.
94 changes: 94 additions & 0 deletions src/beast/base/evolution/alignment/Alignment.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@
*/
package beast.base.evolution.alignment;

import java.io.PrintStream;
import java.util.*;

import org.w3c.dom.Node;

import beast.base.core.Description;
import beast.base.core.Input;
import beast.base.core.Log;
import beast.base.core.Input.Validate;
import beast.base.evolution.datatype.DataType;
import beast.base.inference.StateNode;
import beast.base.inference.parameter.Map;
import beast.pkgmgmt.BEASTClassLoader;
import beast.pkgmgmt.PackageManager;
Expand Down Expand Up @@ -880,5 +884,95 @@ public String getSequenceAsString(String taxon) {
} while (difference > 1E-8 && attempts < 1000);
return freqs;
} // calcFrequencies

@Override
public void init(PrintStream out) {
// TODO Auto-generated method stub

}

@Override
public void log(long sample, PrintStream out) {
// TODO Auto-generated method stub

}

@Override
public void close(PrintStream out) {
// TODO Auto-generated method stub

}

@Override
public int getDimension() {
// TODO Auto-generated method stub
return 0;
}

@Override
public double getArrayValue(int dim) {
// TODO Auto-generated method stub
return 0;
}

@Override
public void setEverythingDirty(boolean isDirty) {
// TODO Auto-generated method stub

}

@Override
public StateNode copy() {
// TODO Auto-generated method stub
return null;
}

@Override
public void assignTo(StateNode other) {
// TODO Auto-generated method stub

}

@Override
public void assignFrom(StateNode other) {
// TODO Auto-generated method stub

}

@Override
public void assignFromFragile(StateNode other) {
// TODO Auto-generated method stub

}

@Override
public void fromXML(Node node) {
// TODO Auto-generated method stub

}

@Override
public String toXML() {
// TODO Auto-generated method stub
return null;
}

@Override
public int scale(double scale) {
// TODO Auto-generated method stub
return 0;
}

@Override
protected void store() {
// TODO Auto-generated method stub

}

@Override
public void restore() {
// TODO Auto-generated method stub

}

} // class Data
6 changes: 2 additions & 4 deletions src/beast/base/inference/StateNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,13 @@ public void assignFromWithoutID(StateNode other) {
* for storing a state *
*/
final public void toXML(PrintStream out) {
out.print("<statenode id='" + normalise(getID()) + "'>");
out.print(normalise(toString()));
out.print("</statenode>\n");
out.println(toXML());
}

/**
* stores a state node in XML format, to be restored by fromXML() *
*/
final public String toXML() {
public String toXML() {
return "<statenode id='" + normalise(getID()) + "'>" +
normalise(toString()) +
"</statenode>\n";
Expand Down
4 changes: 2 additions & 2 deletions src/beast/base/inference/parameter/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import beast.base.core.Description;
import beast.base.core.Input;
import beast.base.inference.CalculationNode;
import beast.base.inference.StateNode;

@Description("Unordered set mapping keys to values")
abstract public class Map<T> extends CalculationNode {
abstract public class Map<T> extends StateNode {

final public Input<java.util.Map<java.lang.String, T>> defaultInput = new Input<>("*",
"Input containing the map", new LinkedHashMap<>());
Expand Down

0 comments on commit 8065aa2

Please sign in to comment.