本文整理汇总了Java中beast.core.util.Log类的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Log类属于beast.core.util包,在下文中一共展示了Log类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:CompEvol,项目名称:beast2,代码行数:17,代码来源:BeagleTreeLikelihood.java
示例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;
}
开发者ID:CompEvol,项目名称:beast2,代码行数:19,代码来源:BeagleTreeLikelihood.java
示例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;
}
开发者ID:CompEvol,项目名称:beast2,代码行数:39,代码来源:TreeLikelihood.java
示例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();
}
开发者ID:CompEvol,项目名称:beast2,代码行数:34,代码来源:NodeReheight.java
示例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;
}
开发者ID:CompEvol,项目名称:beast2,代码行数:25,代码来源:JointOperator.java
示例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;
}
开发者ID:CompEvol,项目名称:beast2,代码行数:11,代码来源:CalibratedYuleModel.java
示例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.");
}
}
开发者ID:CompEvol,项目名称:beast2,代码行数:23,代码来源:YuleModel.java
示例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();
}
开发者ID:CompEvol,项目名称:beast2,代码行数:24,代码来源:YuleModel.java
示例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;
}
开发者ID:CompEvol,项目名称:beast2,代码行数:28,代码来源:TreeAnnotator.java
示例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());
}
}
开发者ID:CompEvol,项目名称:beast2,代码行数:25,代码来源:BEASTObjectPanel.java
示例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());
}
}
开发者ID:CompEvol,项目名称:beast2,代码行数:21,代码来源:HelpBrowser.java
示例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();
}
}
开发者ID:CompEvol,项目名称:beast2,代码行数:23,代码来源:ListInputEditor.java
示例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();
}
开发者ID:CompEvol,项目名称:beast2,代码行数:21,代码来源:Selection.java
示例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());
}
开发者ID:CompEvol,项目名称:beast2,代码行数:28,代码来源:BooleanInputEditor.java
示例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;
}
开发者ID:CompEvol,项目名称:beast2,代码行数:17,代码来源:Arrow.java
示例16: quit
import beast.core.util.Log; //导入依赖的package包/类
boolean quit() {
if (doc.validateModel() == DOC_STATUS.DIRTY) {
int result = JOptionPane.showConfirmDialog(null,
"Do you want to save the Beast specification?",
"Save before closing?", JOptionPane.YES_NO_CANCEL_OPTION);
Log.err.println("result=" + result);
if (result == JOptionPane.CANCEL_OPTION) {
return false;
}
if (result == JOptionPane.YES_OPTION) {
if (!saveAs()) {
return false;
}
}
}
return true;
}
开发者ID:CompEvol,项目名称:beast2,代码行数:18,代码来源:Beauti.java
示例17: link
import beast.core.util.Log; //导入依赖的package包/类
/** links partition in row "rowToLink" with partition in "rowToLinkWith" so that
* after linking there is only one partition for context "columnNr", namely that
* of "rowToLinkWith"
*/
private void link(int columnNr, int rowToLink, int rowToLinkWith) {
Object old = tableData[rowToLink][columnNr];
tableData[rowToLink][columnNr] = tableData[rowToLinkWith][columnNr];
try {
updateModel(columnNr, rowToLink);
} catch (Exception ex) {
Log.warning.println(ex.getMessage());
// unlink if we could not link
tableData[rowToLink][columnNr] = old;
try {
updateModel(columnNr, rowToLink);
} catch (Exception ex2) {
// ignore
}
}
MRCAPriorInputEditor.customConnector(doc);
}
开发者ID:CompEvol,项目名称:beast2,代码行数:22,代码来源:AlignmentListInputEditor.java
示例18: actionPerformed
import beast.core.util.Log; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
// SwingUtilities.invokeLater(new Runnable() {
// @Override
// public void run() {
Log.warning.println("actionPerformed ");
Log.warning.println(table.getSelectedRow() + " " + table.getSelectedColumn());
if (table.getSelectedRow() >= 0 && table.getSelectedColumn() >= 0) {
Log.warning.println(" " + table.getValueAt(table.getSelectedRow(), table.getSelectedColumn()));
}
for (int i = 0; i < partitionCount; i++) {
try {
updateModel(m_nColumn, i);
} catch (Exception ex) {
Log.warning.println(ex.getMessage());
}
}
// }});
}
开发者ID:CompEvol,项目名称:beast2,代码行数:20,代码来源:AlignmentListInputEditor.java
示例19: loadTemplate
import beast.core.util.Log; //导入依赖的package包/类
void loadTemplate(String xml) throws XMLParserException, SAXException, IOException, ParserConfigurationException {
// load the template and its beauti configuration parts
XMLParser parser = new XMLParser();
BEASTObjectPanel.init();
List<BEASTInterface> beastObjects = parser.parseTemplate(xml, new HashMap<>(), true);
for (BEASTInterface beastObject : beastObjects) {
if (beastObject instanceof beast.core.Runnable) {
mcmc.setValue(beastObject, this);
} else if (beastObject instanceof BeautiConfig) {
beautiConfig = (BeautiConfig) beastObject;
beautiConfig.setDoc(this);
} else {
Log.warning.println("template item " + beastObject.getID() + " is ignored");
}
BEASTObjectPanel.addPluginToMap(beastObject, this);
}
}
开发者ID:CompEvol,项目名称:beast2,代码行数:18,代码来源:BeautiDoc.java
示例20: setUpActivePlugins
import beast.core.util.Log; //导入依赖的package包/类
protected void setUpActivePlugins() {
posteriorPredecessors = new ArrayList<>();
collectPredecessors(((MCMC) mcmc.get()).posteriorInput.get(), posteriorPredecessors);
likelihoodPredecessors = new ArrayList<>();
if (pluginmap.containsKey("likelihood")) {
collectPredecessors(pluginmap.get("likelihood"), likelihoodPredecessors);
}
Log.trace.print("InPosterior=");
for (BEASTInterface o : posteriorPredecessors) {
pluginmap.put(o.getID(), o);
Log.trace.print(o.getID() + " ");
//if (!pluginmap.containsKey(o)) {
// System.err.println("MISSING: " + o.getID());
//}
}
Log.trace.println();
}
开发者ID:CompEvol,项目名称:beast2,代码行数:20,代码来源:BeautiDoc.java
注:本文中的beast.core.util.Log类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论