本文整理汇总了Java中org.rosuda.JRI.Rengine.versionCheck方法的典型用法代码示例。如果您正苦于以下问题:Java Rengine.versionCheck方法的具体用法?Java Rengine.versionCheck怎么用?Java Rengine.versionCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rosuda.JRI.Rengine
的用法示例。
在下文中一共展示了Rengine.versionCheck方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public static void main(String[] args) {
// just making sure we have the right version of everything
if (!Rengine.versionCheck()) {
System.err.println("** Version mismatch - Java files don't match library version.");
System.exit(1);
}
System.out.println("Creating Rengine (with arguments)");
Rengine re=new Rengine(args, false, new TextConsole());
System.out.println("Rengine created, waiting for R");
// the engine creates R is a new thread, so we should wait until it's ready
if (!re.waitForR()) {
System.out.println("Cannot load R");
return;
}
selectOneEnabled(re);
selectOneDisabled(re);
selectMostEnabledDisabled(re);
re.end();
System.out.println("end");
}
示例2: main
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public static void main(String[] args) {
// just making sure we have the right version of everything
if (!Rengine.versionCheck()) {
System.err.println("** Version mismatch - Java files don't match library version.");
System.exit(1);
}
System.out.println("Creating Rengine (with arguments)");
re= new Rengine(args, false, new TextConsole());
System.out.println("Rengine created, waiting for R");
// the engine creates R is a new thread, so we should wait until it's ready
if (!re.waitForR()) {
System.out.println("Cannot load R");
System.exit(1);
}
RAnalysis.readCSV(re,"jhipsterFeatures.csv","data");
System.out.println("File read");
//oneEnabled(re);
//oneDisabled(re);
mostEnabledDisabled(re);
re.end();
System.out.println("done");
}
示例3: init
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public void init() {
// Making sure we have the right version of everything
if (!Rengine.versionCheck()) {
System.err.println("** Version mismatch - Java files don't match library version.");
System.exit(1);
}
String[] args = {"--vanilla"};
re = new Rengine(args, false, new TextConsole());
// the engine creates R is a new thread, so we should wait until it's ready
if (!re.waitForR()) {
System.out.println("Cannot load R");
return;
}
}
示例4: setUpR
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
@BeforeClass
public static void setUpR() throws Exception{
// just making sure we have the right version of everything
if (!Rengine.versionCheck()) {
System.err.println("** Version mismatch - Java files don't match library version.");
fail(String.format("Invalid versions. Rengine must have the same version of native library. Rengine version: %d. RNI library version: %d", Rengine.getVersion(), Rengine.rniGetVersion()));
}
// Enables debug traces
Rengine.DEBUG = 1;
System.out.println("Creating Rengine (with arguments)");
// 1) we pass the arguments from the command line
// 2) we won't use the main loop at first, we'll start it later
// (that's the "false" as second argument)
// 3) no callback class will be used
engine = REngine.engineForClass("org.rosuda.REngine.JRI.JRIEngine", new String[] { "--no-save" }, new REngineStdOutput(), false);
System.out.println("Rengine created...");
REXP result = engine.parseAndEval("source(\"/Users/jfcorugedo/Documents/git/RJavaServer/src/test/resources/blockFunction.R\")");
if(result == null) {
LOG.error("blockFunction is not loaded!");
} else {
LOG.info("blockFunction loaded successfully");
}
}
示例5: setUpR
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
@BeforeClass
public static void setUpR() {
// just making sure we have the right version of everything
if (!Rengine.versionCheck()) {
System.err.println("** Version mismatch - Java files don't match library version.");
fail(String.format("Invalid versions. Rengine must have the same version of native library. Rengine version: %d. RNI library version: %d", Rengine.getVersion(), Rengine.rniGetVersion()));
}
// Enables debug traces
Rengine.DEBUG = 1;
System.out.println("Creating Rengine (with arguments)");
// 1) we pass the arguments from the command line
// 2) we won't use the main loop at first, we'll start it later
// (that's the "false" as second argument)
// 3) no callback class will be used
engine = new Rengine(new String[] { "--no-save" }, false, null);
System.out.println("Rengine created, waiting for R");
// the engine creates R is a new thread, so we should wait until it's
// ready
if (!engine.waitForR()) {
fail("Cannot load R");
}
}
示例6: RController
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
private RController(){
logger = Logger.getInstance();
if (!Rengine.versionCheck()) {
logger.logError("** Version mismatch - Java files don't match library version.");
}else{
logger.log("Creating Rengine");
this.re = new Rengine(new String[]{}, false, new TextConsole());
logger.log("Rengine created, waiting for R");
// Wait for REngine new thread to finish loading
if (!re.waitForR()) {
logger.logError("Cannot load R");
}else{
this.hasLoaded = true;
}
}
}
示例7: createREngine
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
private void createREngine(){
if (!Rengine.versionCheck()) {
System.err.println("** Version mismatch - Java files don't match library version.");
System.exit(1);
}
System.out.println("Creating Rengine (with arguments)");
// 1) we pass the arguments from the command line
// 2) we won't use the main loop at first, we'll start it later
// (that's the "false" as second argument)
// 3) the callbacks are implemented by the TextConsole class above
String[] Rargs = {"--no-save"};
re=new Rengine(Rargs, false, new TextConsole());
engineState = EngineState.RUNNING;
System.out.println("Rengine created, waiting for R");
// the engine creates R is a new thread, so we should wait until it's ready
if (!re.waitForR()) {
System.out.println("Cannot load R");
engineState = EngineState.STOPPED;
return;
}
initREngine();
}
示例8: main
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public static void main(String[] args) {
// just making sure we have the right version of everything
if (!Rengine.versionCheck()) {
System.err.println("** Version mismatch - Java files don't match library version.");
System.exit(1);
}
System.out.println("Creating Rengine (with arguments)");
// 1) we pass the arguments from the command line
// 2) we won't use the main loop at first, we'll start it later
// (that's the "false" as second argument)
// 3) the callbacks are implemented by the TextConsole class above
Rengine re=new Rengine(args, false, new TextConsole());
System.out.println("Rengine created, waiting for R");
// the engine creates R is a new thread, so we should wait until it's ready
if (!re.waitForR()) {
System.out.println("Cannot load R");
return;
}
createCircleTypeApp(re);
createCircleBuildResult(re);
createBoxplotTimeBuildWithoutDockerApp(re);
createBoxplotTimeBuildWithDockerApp(re);
createBoxplotTimeBuildWithoutDockerBuildTool(re);
createBoxplotTimeBuildWithDockerBuildTool(re);
createBoxplotTimeCompile(re);
createBoxplotTimeGeneration(re);
createBoxplotCoverage(re);
createBoxplotImageDockerApplications(re);
createBoxplotImageDockerDB(re);
createBalloonPlot(re);
createBalloonPlotBugsFeatures(re);
createPieChartBuildResultByBuildTool(re);
createBoxplotCucumeberDatabase(re);
re.end();
System.out.println("end");
}
示例9: setUpR
import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
/**
* This method initializes REngine properly and make all the operations needed
* to set up the environment.
*
* This JRI implementation must load JRI library and starts JRIEngine
*
*/
@PostConstruct
public void setUpR() {//NOSONAR
try {
//make sure JRI lib can be loaded (it must be present in java.library.path parameter)
//This line is necessary because Rengine.versionCheck() will execute a System.exit if
//it can't load JRI library.
System.loadLibrary("jri");
// just making sure we have the right version of everything
if (!Rengine.versionCheck()) {
LOGGER.error("** Version mismatch - Java files don't match library version.");
LOGGER.error(String.format("Invalid versions. Rengine must have the same version of native library. Rengine version: %d. RNI library version: %d", Rengine.getVersion(), Rengine.rniGetVersion()));
}
// Enables debug traces
Rengine.DEBUG = 1;
if(LOGGER.isInfoEnabled()) {
LOGGER.info("Creating Rengine (with arguments)");
}
// 1) we pass the arguments from the command line
// 2) we won't use the main loop at first, we'll start it later
// (that's the "false" as second argument)
// 3) no callback class will be used
this.engine = REngine.engineForClass("org.rosuda.REngine.JRI.JRIEngine", new String[] { "--no-save" }, new REngineStdOutCallback(LOGGER), false);
if(LOGGER.isInfoEnabled()) {
LOGGER.info("Rengine created...");
LOGGER.info("Loading blockFunction from " + getBlockFunction());
}
REXP result = engine.parseAndEval(getBlockFunction());
if(result == null) {
LOGGER.error("blockFunction is not loaded!");
} else if(LOGGER.isInfoEnabled()) {
LOGGER.info("blockFunction loaded successfully");
}
} catch(Exception|UnsatisfiedLinkError e) {
LOGGER.error("Unexpected error setting up R", e);
}
}