本文整理汇总了Java中beast.core.util.Log类的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Log类属于beast.core.util包,在下文中一共展示了Log类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseSystemPropertyIntegerArray
import beast.core.util.Log; //导入依赖的package包/类
private static List<Integer> parseSystemPropertyIntegerArray(String propertyName) {
List<Integer> order = new ArrayList<>();
String r = System.getProperty(propertyName);
if (r != null) {
String[] parts = r.split(",");
for (String part : parts) {
try {
int n = Integer.parseInt(part.trim());
order.add(n);
} catch (NumberFormatException nfe) {
Log.warning.println("Invalid entry '" + part + "' in " + propertyName);
}
}
}
return order;
}
示例2: parseSystemPropertyStringArray
import beast.core.util.Log; //导入依赖的package包/类
private static List<String> parseSystemPropertyStringArray(String propertyName) {
List<String> order = new ArrayList<>();
String r = System.getProperty(propertyName);
if (r != null) {
String[] parts = r.split(",");
for (String part : parts) {
try {
String s = part.trim();
order.add(s);
} catch (NumberFormatException nfe) {
Log.warning.println("Invalid getEigenDecompositionentry '" + part + "' in " + propertyName);
}
}
}
return order;
}
示例3: calculateLogP
import beast.core.util.Log; //导入依赖的package包/类
@Override
public double calculateLogP() {
if (beagle != null) {
logP = beagle.calculateLogP();
return logP;
}
final TreeInterface tree = treeInput.get();
try {
if (traverse(tree.getRoot()) != Tree.IS_CLEAN)
calcLogP();
}
catch (ArithmeticException e) {
return Double.NEGATIVE_INFINITY;
}
m_nScale++;
if (logP > 0 || (likelihoodCore.getUseScaling() && m_nScale > X)) {
// System.err.println("Switch off scaling");
// m_likelihoodCore.setUseScaling(1.0);
// m_likelihoodCore.unstore();
// m_nHasDirt = Tree.IS_FILTHY;
// X *= 2;
// traverse(tree.getRoot());
// calcLogP();
// return logP;
} else if (logP == Double.NEGATIVE_INFINITY && m_fScale < 10 && !scaling.get().equals(Scaling.none)) { // && !m_likelihoodCore.getUseScaling()) {
m_nScale = 0;
m_fScale *= 1.01;
Log.warning.println("Turning on scaling to prevent numeric instability " + m_fScale);
likelihoodCore.setUseScaling(m_fScale);
likelihoodCore.unstore();
hasDirt = Tree.IS_FILTHY;
traverse(tree.getRoot());
calcLogP();
return logP;
}
return logP;
}
示例4: initAndValidate
import beast.core.util.Log; //导入依赖的package包/类
@Override
public void initAndValidate() {
/** maps gene taxa names to species number **/
final Map<String, Integer> taxonMap = new HashMap<>();
final List<Taxon> list = taxonSetInput.get().taxonsetInput.get();
if (list.size() <= 1) {
Log.err.println("NodeReheight operator requires at least 2 taxa while the taxon set (id=" + taxonSetInput.get().getID() +") has only " + list.size() + " taxa. "
+ "If the XML file was set up in BEAUti, this probably means a taxon assignment needs to be set up in the taxonset panel.");
// assume we are in BEAUti, back off for now
return;
}
for (int i = 0; i < list.size(); i++) {
final Taxon taxa = list.get(i);
// cast should be ok if taxon-set is the set for the species tree
final TaxonSet set = (TaxonSet) taxa;
for (final Taxon taxon : set.taxonsetInput.get()) {
taxonMap.put(taxon.getID(), i);
}
}
/** build the taxon map for each gene tree **/
m_taxonMap = new ArrayList<>();
for (final Tree tree : geneTreesInput.get()) {
final Map<Integer, Integer> map = new HashMap<>();
setupTaxaMap(tree.getRoot(), map, taxonMap);
m_taxonMap.add(map);
}
nrOfGeneTrees = geneTreesInput.get().size();
nrOfSpecies = treeInput.get().getLeafNodeCount();
}
示例5: proposal
import beast.core.util.Log; //导入依赖的package包/类
@Override
public double proposal() {
double logHR = 0;
for (Operator op : operatorsInput.get()) {
logHR += op.proposal();
// Stop here if the move is going to be rejected anyway
if (logHR == Double.NEGATIVE_INFINITY)
break;
// Update calculation nodes as subsequent operators may depend on
// state nodes made dirty by this operation.
try {
if (!op.listStateNodes().isEmpty())
op.listStateNodes().get(0).getState().checkCalculationNodesDirtiness();
} catch (Exception ex) {
Log.err(ex.getMessage());
}
}
return logHR;
}
示例6: issueSlowWarning
import beast.core.util.Log; //导入依赖的package包/类
private void issueSlowWarning() {
if( ! warningIssued )
Log.warning("This calibrated Yule analysis with " + orderedCalibrations.length + " calibrations will take a looong time.\n"
+"Possibly will never complete even a single step. You can change the type of the calibration to 'none' (type=\"none\"\n"
+ "in the XML) and get the non-calibrated Yule just like in BEAST1, or set type to \"restricted\", a variant of the\n" +
"calibrated Yule which runs faster and where the proterior distribution of the node times is more similar to the\n" +
"actual calibration than the \"none\" case. In both cases test to see how far your posterior calibrations are from the " +
"specifications.");
warningIssued = true;
}
示例7: initAndValidate
import beast.core.util.Log; //导入依赖的package包/类
@Override
public void initAndValidate() {
super.initAndValidate();
conditionalOnRoot = conditionalOnRootInput.get();
conditionalOnOrigin = originHeightParameterInput.get() != null;
if (conditionalOnRoot && conditionalOnOrigin) {
throw new RuntimeException("ERROR: Cannot condition on both root and origin.");
}
// make sure that all tips are at the same height,
// otherwise this Yule Model is not appropriate
TreeInterface tree = treeInput.get();
if (tree == null) {
tree = treeIntervalsInput.get().treeInput.get();
}
if (!TreeUtils.isUltrametric(tree)) {
Log.warning.println("WARNING: This model (tree prior) cannot handle dated tips. " +
"Please select a tree prior which can, otherwise " +
"results may be invalid.");
}
}
示例8: validateInputs
import beast.core.util.Log; //导入依赖的package包/类
@Override
public void validateInputs() {
if (conditionalOnRootInput.get()) {
// make sure there is an MRCAPrior on the root
TreeInterface tree = treeInput.get();
int n = tree.getTaxonset().getTaxonCount();
boolean found = false;
for (BEASTInterface o : ((BEASTInterface) tree).getOutputs()) {
if (o instanceof MRCAPrior) {
MRCAPrior prior = (MRCAPrior) o;
int n2 = prior.taxonsetInput.get().taxonsetInput.get().size();
if (n2 == n) {
found = true;
}
}
}
if (!found) {
Log.warning("WARNING: There must be an MRCAPrior on the root when conditionalOnRoot=true, but could not find any");
}
}
super.validateInputs();
}
示例9: parseTranslateBlock
import beast.core.util.Log; //导入依赖的package包/类
/**
* @return a map of taxa translations, keys are generally integer node number starting from 1
* whereas values are generally descriptive strings.
* @throws IOException
*/
private Map<String, String> parseTranslateBlock() throws IOException {
final Map<String, String> translationMap = new HashMap<>();
String line = readLine();
final StringBuilder translateBlock = new StringBuilder();
while (line != null && !line.trim().toLowerCase().equals(";")) {
translateBlock.append(line.trim());
line = readLine();
}
final String[] taxaTranslations = translateBlock.toString().split(",");
for (final String taxaTranslation : taxaTranslations) {
final String[] translation = taxaTranslation.split("[\t ]+");
if (translation.length == 2) {
translationMap.put(translation[0], translation[1]);
// System.out.println(translation[0] + " -> " + translation[1]);
} else {
Log.err.println("Ignoring translation:" + Arrays.toString(translation));
}
}
return translationMap;
}
示例10: addPluginToMap
import beast.core.util.Log; //导入依赖的package包/类
static public void addPluginToMap(BEASTInterface beastObject, BeautiDoc doc) {
if (registerPlugin(getID(beastObject), beastObject, doc)) {
return;
}
try {
for (Input<?> input : beastObject.listInputs()) {
if (input.get() != null) {
if (input.get() instanceof BEASTInterface) {
addPluginToMap((BEASTInterface) input.get(), doc);
}
if (input.get() instanceof List<?>) {
for (Object o : (List<?>) input.get()) {
if (o instanceof BEASTInterface) {
addPluginToMap((BEASTInterface) o, doc);
}
}
}
}
}
} catch (Exception e) {
// ignore
Log.warning.println(e.getClass().getName() + " " + e.getMessage());
}
}
示例11: hyperlinkUpdate
import beast.core.util.Log; //导入依赖的package包/类
@Override
public void hyperlinkUpdate(HyperlinkEvent link) {
try {
HyperlinkEvent.EventType type = link.getEventType();
if (type == HyperlinkEvent.EventType.ACTIVATED) {
String beastObjectName = link.getDescription();
beastObjectName = beastObjectName.replaceAll(".html", "");
// update browser stack
m_iCurrentPlugin++;
while (m_iCurrentPlugin < m_sPlugins.size()) {
m_sPlugins.remove(m_iCurrentPlugin);
}
m_sPlugins.add(beastObjectName);
updateState();
}
} catch (Exception e) {
// ignore
Log.err.println(e.getMessage());
}
}
示例12: addItem
import beast.core.util.Log; //导入依赖的package包/类
protected void addItem() {
List<String> tabuList = new ArrayList<>();
for (int i = 0; i < m_entries.size(); i++) {
tabuList.add(m_entries.get(i).getText());
}
List<BEASTInterface> beastObjects = pluginSelector(m_input, m_beastObject, tabuList);
if (beastObjects != null) {
for (BEASTInterface beastObject : beastObjects) {
try {
setValue(beastObject);
//m_input.setValue(beastObject, m_beastObject);
} catch (Exception ex) {
Log.err.println(ex.getClass().getName() + " " + ex.getMessage());
}
addSingleItem(beastObject);
getDoc().addPlugin(beastObject);
}
validateInput();
updateState();
repaint();
}
}
示例13: toggleSelection
import beast.core.util.Log; //导入依赖的package包/类
void toggleSelection(int selectionIndex) {
if (!contains(selectionIndex)) {
addToSelection(selectionIndex);
} else {
m_tracker.removeAll(m_tracker);
for (int i = 0; i < m_Selection.size(); i++) {
if (selectionIndex == m_Selection.get(i).intValue()) {
m_Selection.remove(i);
i--;
} else {
List<TrackPoint> tracker = m_doc.m_objects.get(m_Selection.get(i).intValue()).getTracker();
m_tracker.addAll(tracker);
}
}
}
for (int i = 0; i < m_Selection.size(); i++) {
Log.warning.print(m_Selection.get(i) + " ");
}
Log.warning.println();
}
示例14: init
import beast.core.util.Log; //导入依赖的package包/类
/**
* create input editor containing a check box *
*/
@Override
public void init(Input<?> input, BEASTInterface beastObject, int itemNr, ExpandOption isExpandOption, boolean addButtons) {
m_bAddButtons = addButtons;
m_beastObject = beastObject;
m_input = input;
this.itemNr = itemNr;
m_entry = new JCheckBox(formatName(m_input.getName()));
if (input.get() != null) {
m_entry.setSelected((Boolean) input.get());
}
m_entry.setToolTipText(input.getHTMLTipText());
m_entry.addActionListener(e -> {
try {
setValue(m_entry.isSelected());
refreshPanel();
//validateInput();
//m_input.setValue(m_entry.isSelected(), m_beastObject);
} catch (Exception ex) {
Log.err.println("BooleanInputEditor " + ex.getMessage());
}
});
add(m_entry);
add(Box.createHorizontalGlue());
}
示例15: Arrow
import beast.core.util.Log; //导入依赖的package包/类
public Arrow(BEASTObjectShape tailShape, BEASTObjectShape headShape, String inputName) {
m_sTailID = tailShape.getID();
m_tailShape = tailShape;
InputShape input = headShape.getInputShape(inputName);
if (input == null) {
Log.warning.println("Arrow from " + tailShape.m_beastObject.getID() + " to " + headShape.m_beastObject.getID() + "." + inputName + " skipped");
}
m_sHeadID = input.getID();
m_headShape = input;
//m_sHeadID = headShape.m_id;
m_x = 0;
m_y = 0;
m_w = 1;
m_h = 1;
m_pencolor = Color.gray;
}