-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathalgorithmic.R
84 lines (51 loc) · 1.81 KB
/
algorithmic.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#' @name algorithmic-KINOMO
#' @rdname algorithmic
NULL
#' @rdname algorithmic
setGeneric('algorithm<-', function(object, ..., value) standardGeneric('algorithm<-') )
#' @rdname algorithmic
setGeneric('seeding', function(object, ...) standardGeneric('seeding') )
setGeneric('seeding<-', function(object, ..., value) standardGeneric('seeding<-') )
#' @rdname algorithmic
setGeneric('niter', function(object, ...) standardGeneric('niter'))
#' @export
setGeneric('niter<-', function(object, ..., value) standardGeneric('niter<-'))
#' @rdname algorithmic
setGeneric('nrun', function(object, ...) standardGeneric('nrun') )
setMethod('nrun', 'ANY',
function(object){
attr(object, 'nrun')
}
)
#' @rdname algorithmic
setGeneric('objective', function(object, ...) standardGeneric('objective'))
#' @export
#' @rdname algorithmic
setGeneric('objective<-', function(object, ..., value) standardGeneric('objective<-'))
setGeneric('runtime', function(object, ...) standardGeneric('runtime') )
#' @rdname algorithmic
setGeneric('runtime.all', function(object, ...) standardGeneric('runtime.all') )
#' @rdname algorithmic
setGeneric('seqtime', function(object, ...) standardGeneric('seqtime') )
#' @export
setGeneric('modelname', function(object, ...) standardGeneric('modelname'))
setMethod('modelname', 'ANY',
function(object)
{
as.character(class(object))
}
)
#' @rdname algorithmic
setGeneric('run', function(object, y, x, ...) standardGeneric('run'))
setGeneric('logs', function(object, ...) standardGeneric('logs'))
#' It returns \code{NULL} if no logging data was found.
setMethod('logs', 'ANY',
function(object)
{
res <- attr(object, 'logs')
if( !is.null(res) ) res
else if( is.list(object) ) object$logs
}
)
#' @rdname algorithmic
setGeneric('compare', function(object, ...) standardGeneric('compare') )