[Rcolony-commits] r23 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Apr 24 18:43:54 CEST 2009
Author: jonesor
Date: 2009-04-24 18:43:53 +0200 (Fri, 24 Apr 2009)
New Revision: 23
Modified:
pkg/R/monitor.colony.R
pkg/R/run.colony.R
Log:
Fixed bug in run.colony which caused colony to be run twice simultaneously
Modified: pkg/R/monitor.colony.R
===================================================================
--- pkg/R/monitor.colony.R 2009-04-24 16:18:25 UTC (rev 22)
+++ pkg/R/monitor.colony.R 2009-04-24 16:43:53 UTC (rev 23)
@@ -18,8 +18,9 @@
if(elapsed.t>interv.t){
fileok<-file.exists(paste(datadir,"temp.txt",sep=""))
-
-if(fileok==TRUE&!is.na(get.interm.data(datadir=datadir,variable=variable,n=n)[1,1])){
+
+if(fileok==TRUE){
+if(!is.na(get.interm.data(datadir=datadir,variable=variable,n=n)[1,1])){
MidResult2<-get.interm.data(datadir=datadir,variable=variable,n=n)
MidResult<-rbind(MidResult,MidResult2)
MidResult<-unique(MidResult)
@@ -27,7 +28,11 @@
x<-MidResult[,1]
y<-MidResult[,2]
-plot(x,y,type="b",xlab="",ylab="")
+plot(x,y,xlab="",ylab="",type="n")
+points(x,y,type="b")
+
+#add points to show max and min reached till that point
+
title(xlab="NumIterate",ylab=variable)
#add routine to delete contents if file is too big.
@@ -44,7 +49,7 @@
cat("Plotting. Hit Esc to stop\n")
- }else{cat("Waiting...\n")}
+ }}else{cat("Waiting...\n")}
Modified: pkg/R/run.colony.R
===================================================================
--- pkg/R/run.colony.R 2009-04-24 16:18:25 UTC (rev 22)
+++ pkg/R/run.colony.R 2009-04-24 16:43:53 UTC (rev 23)
@@ -13,7 +13,9 @@
datadir<-sub("([A-Z a-z0-9:/\\]+[/\\]+)([A-Z.a-z0-9]+)","\\1",datfilepath)
filename<-sub("([A-Z a-z0-9:/\\]+[/\\]+)([A-Z.a-z0-9]+)","\\2",datfilepath)
+colonyexec<-sub("([A-Z a-z0-9:/\\]+[/\\]+)([A-Z.a-z0-9]+)","\\2",colonyexecpath)
+
current.wd<-getwd()
#Extract the output file name defined in the colony file.
@@ -51,7 +53,6 @@
#There is currently no way of monitoring the Windows system.
if(monitor==TRUE){system("./Colony2.exe 2>&1 | tee temp.txt",wait=wait)}else{system("./Colony2.exe",wait=wait)}
-foo<-system("./Colony2.exe",intern=TRUE)
#Remove the Colony2.exe and
system(paste("rm",colonyexec))
@@ -60,6 +61,9 @@
}else{if(platform$OS.type=="windows"){
+
+#THIS NEEDS TESTING
+
#Windows commands
shell(paste("copy",colonyexecpath,datadir,sep=" "))#Copy the colony exe file to the project directory
shell(paste("rename",paste(datadir,filename,sep=""),paste(datadir,"Colony2.DAT",sep=""),sep=" "))#Rename the colony dat file as Colony2.DAT
More information about the Rcolony-commits
mailing list