• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExecutionMonitor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.knime.core.node.ExecutionMonitor的典型用法代码示例。如果您正苦于以下问题:Java ExecutionMonitor类的具体用法?Java ExecutionMonitor怎么用?Java ExecutionMonitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExecutionMonitor类属于org.knime.core.node包,在下文中一共展示了ExecutionMonitor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void loadInternals(final File internDir,
        final ExecutionMonitor exec) throws IOException,
        CanceledExecutionException {
    
    // TODO load internal data. 
    // Everything handed to output ports is loaded automatically (data
    // returned by the execute method, models loaded in loadModelContent,
    // and user settings set through loadSettingsFrom - is all taken care 
    // of). Load here only the other internals that need to be restored
    // (e.g. data used by the views).
	logger.info("---------------- ENTRANDO NO MÉTODO loadInternals()-----------------------");
	logger.info("String m_selStr: " + m_selStr.toString());
	
}
 
开发者ID:daniacs,项目名称:knime_brtagger,代码行数:19,代码来源:BrTaggerNodeModel.java


示例2: loadInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void loadInternals(final File nodeInternDir,
        final ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {

    final String path = nodeInternDir.getAbsolutePath();

    final File file = new File(path + "LoopEndNode.intern");

    final DataInputStream is =
            new DataInputStream(new FileInputStream(file));

    final int numClasses = is.readInt();

    for (int i = 0; i < numClasses; i++) {
        m_classModel.addClass(is.readUTF());
    }
    is.close();
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:23,代码来源:ActiveLearnLoopEndNodeModel.java


示例3: saveInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void saveInternals(final File nodeInternDir,
        final ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {

    final String path = nodeInternDir.getAbsolutePath();

    final File file = new File(path + "LoopEndNode.intern");

    // save the defined classes
    final DataOutputStream os =
            new DataOutputStream(new FileOutputStream(file));

    os.writeInt(m_classModel.getSize());

    for (final String clsName : m_classModel.getDefinedClasses()) {
        os.writeUTF(clsName);
    }
    os.close();
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:24,代码来源:ActiveLearnLoopEndNodeModel.java


示例4: createCellFactory

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * Creates a CellFactory for the class column.
 *
 * @param colName
 *            the name of the class column
 * @return CellFactory for the class column.
 */
private CellFactory createCellFactory(final String colName) {
    return new CellFactory() {

        @Override
        public void setProgress(final int curRowNr, final int rowCount,
                final RowKey lastKey, final ExecutionMonitor exec) {
            exec.setProgress((double) curRowNr / rowCount);
        }

        @Override
        public DataColumnSpec[] getColumnSpecs() {
            return new DataColumnSpec[] {
                    new DataColumnSpecCreator(colName, StringCell.TYPE)
                            .createSpec() };
        }

        @Override
        public DataCell[] getCells(final DataRow row) {
            throw new IllegalStateException(
                    new IllegalAccessException("This shouldn't be called"));
        }
    };
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:31,代码来源:ActiveLearnLoopStartNodeModel.java


示例5: createResRearranger

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
private ColumnRearranger createResRearranger(final DataTableSpec inSpec) {
    final ColumnRearranger rearranger = new ColumnRearranger(inSpec);
    rearranger.append(new CellFactory() {

        @Override
        public void setProgress(final int curRowNr, final int rowCount,
                final RowKey lastKey, final ExecutionMonitor exec) {
            exec.setProgress((double) curRowNr / rowCount);

        }

        @Override
        public DataColumnSpec[] getColumnSpecs() {
            return new DataColumnSpec[] {
                    new DataColumnSpecCreator("Graph Density Score",
                            DoubleCell.TYPE).createSpec() };
        }

        @Override
        public DataCell[] getCells(final DataRow row) {
            return new DataCell[] { new DoubleCell(
                    m_dataPoints.get(row.getKey()).getDensity()) };
        }
    });
    return rearranger;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:27,代码来源:GraphDensityScorerNodeModel.java


示例6: testWithoutWeights

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
@Test
public void testWithoutWeights() throws PersistenceException, CanceledExecutionException {
	Mockito.when(view.getEdgeWeight(e12)).thenReturn(1.0);
	Mockito.when(view.getEdgeWeight(e13)).thenReturn(1.0);
	Mockito.when(view.getEdgeWeight(e14)).thenReturn(1.0);
	Mockito.when(view.getEdgeWeight(e15)).thenReturn(1.0);
	Mockito.when(view.getEdgeWeight(e23)).thenReturn(1.0);
	Mockito.when(view.getEdgeWeight(e34)).thenReturn(1.0);

	ClosenessAnalyzerType analyzer = new ClosenessAnalyzerType();

	analyzer.initializeInternal(view, new ExecutionMonitor());

	assertEquals(1.0 / 4.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n1)[0], 0.0);
	assertEquals(1.0 / 6.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n2)[0], 0.0);
	assertEquals(1.0 / 5.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n3)[0], 0.0);
	assertEquals(1.0 / 6.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n4)[0], 0.0);
	assertEquals(1.0 / 7.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n5)[0], 0.0);
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:20,代码来源:ClosenessAnalyzerTypeTest.java


示例7: testWithWeights

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
@Test
public void testWithWeights() throws PersistenceException, CanceledExecutionException {
	Mockito.when(view.getEdgeWeight(e12)).thenReturn(2.0);
	Mockito.when(view.getEdgeWeight(e13)).thenReturn(2.0);
	Mockito.when(view.getEdgeWeight(e14)).thenReturn(2.0);
	Mockito.when(view.getEdgeWeight(e15)).thenReturn(2.0);
	Mockito.when(view.getEdgeWeight(e23)).thenReturn(1.0);
	Mockito.when(view.getEdgeWeight(e34)).thenReturn(1.0);

	ClosenessAnalyzerType analyzer = new ClosenessAnalyzerType();

	analyzer.initializeInternal(view, new ExecutionMonitor());

	assertEquals(1.0 / 8.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n1)[0], 0.0);
	assertEquals(1.0 / 9.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n2)[0], 0.0);
	assertEquals(1.0 / 8.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n3)[0], 0.0);
	assertEquals(1.0 / 9.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n4)[0], 0.0);
	assertEquals(1.0 / 14.0, analyzer.numericAnalyzeInternal(new ExecutionMonitor(), view, n5)[0], 0.0);
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:20,代码来源:ClosenessAnalyzerTypeTest.java


示例8: initializeInternal

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
@Override
protected void initializeInternal(KPartiteGraphView<PersistentObject, Partition> view, ExecutionMonitor exec)
		throws PersistenceException, CanceledExecutionException {
	super.initializeInternal(view, exec);
	numberOfNodes = (int) view.getNoOfNodes();
	numberOfEdges = (int) view.getNoOfEdges();
	edgeWeights.clear();
	incidentNodes.clear();
	outgoingEdges.clear();

	for (PersistentObject edge : view.getEdges()) {
		edgeWeights.put(edge.getId(), view.getEdgeWeight(edge));
		incidentNodes.put(edge.getId(),
				view.getIncidentNodes(edge).stream().map(o -> o.getId()).collect(Collectors.toList()));
	}

	if (edgeWeights.values().stream().allMatch(v -> v == 1.0)) {
		edgeWeights.clear();
	}

	for (PersistentObject node : view.getNodes()) {
		outgoingEdges.put(node.getId(),
				view.getOutgoingEdges(node).stream().map(o -> o.getId()).collect(Collectors.toList()));
	}
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:26,代码来源:ClosenessAnalyzerType.java


示例9: saveInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void saveInternals(final File internDir,
        final ExecutionMonitor exec) throws IOException,
        CanceledExecutionException {
   
    // TODO save internal models. 
    // Everything written to output ports is saved automatically (data
    // returned by the execute method, models saved in the saveModelContent,
    // and user settings saved through saveSettingsTo - is all taken care 
    // of). Save here only the other internals that need to be preserved
    // (e.g. data used by the views).
	logger.info("---------------- ENTRANDO NO MÉTODO saveInternals()-----------------------");
	logger.info("String m_selStr: " + m_selStr.toString());
}
 
开发者ID:daniacs,项目名称:knime_brtagger,代码行数:18,代码来源:BrTaggerNodeModel.java


示例10: loadInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void loadInternals(final File nodeInternDir,
        final ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {
    //
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:10,代码来源:ActiveLearnLoopStartNodeModel.java


示例11: saveInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void saveInternals(final File nodeInternDir,
        final ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {
    //
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:10,代码来源:ActiveLearnLoopStartNodeModel.java


示例12: createResRearranger

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
private ColumnRearranger createResRearranger(final DataTableSpec inSpec) {
    final ColumnRearranger rearranger = new ColumnRearranger(inSpec);
    rearranger.append(new CellFactory() {

        @Override
        public void setProgress(final int curRowNr, final int rowCount,
                final RowKey lastKey, final ExecutionMonitor exec) {
            exec.setProgress((double) curRowNr / rowCount);

        }

        @Override
        public DataColumnSpec[] getColumnSpecs() {
            return new DataColumnSpec[] {
                    new DataColumnSpecCreator("Potential", DoubleCell.TYPE)
                            .createSpec(),
                    new DataColumnSpecCreator("Entropy", DoubleCell.TYPE)
                            .createSpec(),
                    new DataColumnSpecCreator("Score", DoubleCell.TYPE)
                            .createSpec() };
        }

        @Override
        public DataCell[] getCells(final DataRow row) {
            return new DataCell[] {
                    new DoubleCell(
                            m_dataPoints.get(row.getKey()).getPotential()),
                    new DoubleCell(
                            m_dataPoints.get(row.getKey()).getEntropy()),
                    new DoubleCell(
                            m_dataPoints.get(row.getKey()).getScore()) };
        }
    });

    return rearranger;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:37,代码来源:PBACScorerNodeModel.java


示例13: loadInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void loadInternals(final File nodeInternDir,
        final ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {
    // Nothing to do here
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:10,代码来源:PBACScorerNodeModel.java


示例14: saveInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void saveInternals(final File nodeInternDir,
        final ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {
    // Nothing to do here
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:10,代码来源:PBACScorerNodeModel.java


示例15: createResRearranger

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
private ColumnRearranger createResRearranger(final DataTableSpec inSpec) {
    final ColumnRearranger rearranger = new ColumnRearranger(inSpec);
    rearranger.append(new CellFactory() {

        @Override
        public void setProgress(final int curRowNr, final int rowCount,
                final RowKey lastKey, final ExecutionMonitor exec) {
            exec.setProgress((double) curRowNr / rowCount);

        }

        @Override
        public DataColumnSpec[] getColumnSpecs() {
            return new DataColumnSpec[] {
                    new DataColumnSpecCreator("Node Potential Score",
                            DoubleCell.TYPE).createSpec() };
        }

        @Override
        public DataCell[] getCells(final DataRow row) {

            return new DataCell[] { new DoubleCell(
                    m_dataPoints.get(row.getKey()).getPotential()) };
        }
    });

    return rearranger;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:29,代码来源:NodePotentialScorerNodeModel.java


示例16: LocalNoveltyScorer

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
public LocalNoveltyScorer(final ExecutionMonitor executionMonitor,
        final RealMatrix m_globalKernelMatrix,
        final RealMatrix m_trainingKernelMatrix, final String[] m_labels,
        final int m_numNeighbors, final boolean m_normalize) {
    super();
    m_exec = executionMonitor;
    this.m_globalKernelMatrix = m_globalKernelMatrix;
    this.m_trainingKernelMatrix = m_trainingKernelMatrix;
    this.m_labels = m_labels;
    this.m_numNeighbors = m_numNeighbors;
    this.m_normalize = m_normalize;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:13,代码来源:LocalNoveltyScorer.java


示例17: load

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
@Override
protected void load(final PortObjectZipInputStream in,
        final PortObjectSpec spec, final ExecutionMonitor exec)
                throws IOException, CanceledExecutionException {
    ObjectInputStream oi = null;
    KNFST knfst = null;
    try {
        // load classifier
        final ZipEntry zentry = in.getNextEntry();
        assert zentry.getName().equals("knfst.objectout");
        oi = new ObjectInputStream(new NonClosableInputStream.Zip(in));
        knfst = (KNFST) Class.forName(oi.readUTF()).newInstance();
        knfst.readExternal(oi);
    } catch (final IOException ioe) {

    } catch (final ClassNotFoundException cnf) {

    } catch (final InstantiationException | IllegalAccessException e) {
        e.printStackTrace();
    } finally {
        if (oi != null) {
            try {
                oi.close();
            } catch (final Exception e) {

            }
        }
    }
    m_knfstModel = knfst;
    m_spec = (KNFSTPortObjectSpec) spec;
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:32,代码来源:KNFSTPortObject.java


示例18: loadInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void loadInternals(final File internDir,
        final ExecutionMonitor exec) throws IOException,
        CanceledExecutionException {
    
    // TODO load internal data. 
    // Everything handed to output ports is loaded automatically (data
    // returned by the execute method, models loaded in loadModelContent,
    // and user settings set through loadSettingsFrom - is all taken care 
    // of). Load here only the other internals that need to be restored
    // (e.g. data used by the views).

}
 
开发者ID:knime,项目名称:knime-sdk-setup,代码行数:17,代码来源:MyExampleNodeNodeModel.java


示例19: saveInternals

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void saveInternals(final File internDir,
        final ExecutionMonitor exec) throws IOException,
        CanceledExecutionException {
   
    // TODO save internal models. 
    // Everything written to output ports is saved automatically (data
    // returned by the execute method, models saved in the saveModelContent,
    // and user settings saved through saveSettingsTo - is all taken care 
    // of). Save here only the other internals that need to be preserved
    // (e.g. data used by the views).

}
 
开发者ID:knime,项目名称:knime-sdk-setup,代码行数:17,代码来源:MyExampleNodeNodeModel.java


示例20: setProgress

import org.knime.core.node.ExecutionMonitor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void setProgress(final int curRowNr, final int rowCount,
        final RowKey lastKey,
        final ExecutionMonitor exec) {
    exec.setProgress(curRowNr / (double)rowCount, "Processed row "
            + curRowNr + " (\"" + lastKey + "\")");
}
 
开发者ID:pavloff-de,项目名称:spark4knime,代码行数:11,代码来源:JavaSnippetCellFactory.java



注:本文中的org.knime.core.node.ExecutionMonitor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Type类代码示例发布时间:2022-05-22
下一篇:
Java LuhnAlgorithm类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap