Skip to content

Commit

Permalink
version 0.8-6
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetzoldt authored and gaborcsardi committed Mar 19, 2015
1 parent bdc7ae3 commit 3572d08
Show file tree
Hide file tree
Showing 28 changed files with 1,047 additions and 952 deletions.
21 changes: 9 additions & 12 deletions DESCRIPTION
@@ -1,23 +1,20 @@
Package: simecol
Version: 0.8-4
Date: 2013-09-15
Title: Simulation of ecological (and other) dynamic systems
Version: 0.8-6
Date: 2015-03-19
Title: Simulation of Ecological (and Other) Dynamic Systems
Author: Thomas Petzoldt
Depends: R (>= 2.14), deSolve, methods
Suggests: tcltk, FME, lattice
LazyLoad: yes
Maintainer: Thomas Petzoldt <thomas.petzoldt@tu-dresden.de>
Description: simecol is an object oriented framework to simulate
Description: An object oriented framework to simulate
ecological (and other) dynamic systems. It can be used for
differential equations, individual-based (or agent-based) and other
models as well. The package helps to organize scenarios (avoids copy
and paste) and improves readability and usability of code.
models as well. The package helps to organize scenarios (to avoid copy
and paste) and aims to improve readability and usability of code.
License: GPL (>= 2)
URL: http://www.simecol.de/
Repository: CRAN
Repository/R-Forge/Project: simecol
Repository/R-Forge/Revision: 233
Repository/R-Forge/DateTimeStamp: 2013-09-15 19:31:06
Date/Publication: 2013-09-26 16:46:19
Packaged: 2013-09-15 22:16:17 UTC; rforge
Packaged: 2015-03-19 22:26:59 UTC; thpe
NeedsCompilation: yes
Repository: CRAN
Date/Publication: 2015-03-20 00:10:09
50 changes: 25 additions & 25 deletions MD5
@@ -1,10 +1,10 @@
c569ab56824be3e7cc1a2bca125773cf *DESCRIPTION
591d63ab5fed4cf53c9241339bee9193 *DESCRIPTION
8dc956c2b8515fe2c0bdba921844e357 *NAMESPACE
9b3e977812938b50737f9d905d919bb1 *R/aaa_classes.R
dcdfcf37b1b245dd72d88302df9d0666 *R/accessors.R
ead60e8d7e43b62af4d74a0a1240d401 *R/addtoenv.R
ebb237823188205d74a6a3082d1fbce2 *R/approxTime.R
09c03a23d9962eb71aca2e955af08551 *R/approxTime1.R
f98047ae3b7e95b3a0f929a3bedb090a *R/approxTime1.R
c65fc62147b88ab243a7684ccbcec649 *R/coerce.R
a5379ee42bda991b14ea9e46e344acb3 *R/constructors.R
b8fcf7f00647a1069d66860862bea2e9 *R/fitOdeModel.R
Expand All @@ -17,35 +17,37 @@ d7eab92ba17bd2fb34dc789a20ec73b9 *R/p.constrain.R
0719e8a29a02a5cf86396f1675a3c841 *R/peaks.R
dbb07e9ddca5da66b1e0e82d2b04a191 *R/plot.R
d8d5b8a7be1e8670338710e2272bfcf2 *R/print.R
ffdb1434b99b715905ec4a136c243a4a *R/sEdit.R
01739a17acc13edf9500d2baaa2211b8 *R/sEdit.R
39879de326abda25f182cf5d0b98292a *R/seedfill.R
896d78634a193e0afdc17d6229355e01 *R/sim.R
e5798526ebd6cda070d03453304f4a82 *R/ssqOdeModel.R
bfbff675c228f77fbdb6a0bab7d2f73e *build/vignette.rds
06684fd2459e2302c8df2b950beee91e *data/CA.rda
06c90e25c8eb5577403e16630d5fbbf5 *data/chemostat.rda
96fd0f3342b927a364eae2bc2eb07748 *data/conway.rda
f38f5bb7716bd91543fd16f8cda224bb *data/diffusion.rda
63d43bae055c6fb87e88e4a2c43fcf83 *data/lv.rda
dc22837cb657e3d512fb942ae0db7548 *data/lv3.rda
9868bb0e3fa47cb670eeb711480e89fa *data/upca.rda
7976aef969f073902e7c81988a525838 *build/vignette.rds
29b6fb5733cd215588630781b1436c64 *data/CA.rda
666abfe50ed7248313e334567511b13b *data/chemostat.rda
8d093a41e7b4c8bba2e3b5103d87d471 *data/conway.rda
19f923845a3b889951e132655ce3bc2b *data/diffusion.rda
dde696004aa9bb419de2eade73b8e9e2 *data/lv.rda
46ada8d07947a248a4d26fd3cb07baa4 *data/lv3.rda
2e80d0874c93df7b90398c079c400cbe *data/upca.rda
8609cb45cbc05486f13e258b1026ef2a *demo/00Index
c5e1ac25087f98c1bc357fd5ad975561 *demo/jss.R
9a77470f3875554ab310e35a6404177e *inst/CITATION
a0e45d853a7be1b36de0087c212c667b *inst/FAQ.txt
8554f0b77afc12e9d51006abdc831bd4 *inst/NEWS
3ca75e33c04d9c3d7e6398e52d8eadae *inst/NEWS
5ef8cae20fab098566d2c044345bb395 *inst/THANKS
a2c178d0363b6c5cadd5df3e76491f35 *inst/doc/a-simecol-introduction.R
bc595de111a1e74bea5b3add648704c9 *inst/doc/a-simecol-introduction.Rnw
c7602161cd989f7be6b00177df376a2c *inst/doc/a-simecol-introduction.pdf
82a8dc0396527a35588f7ad61c59c123 *inst/doc/b-simecol-howtos.R
0768fd1de97df535827351ccf4fbcbcf *inst/doc/a-simecol-introduction.R
aa0ef034e0eaa221822d5aa0f11edd27 *inst/doc/a-simecol-introduction.Rnw
c5505e438c42a9a2850df40e2c520f82 *inst/doc/a-simecol-introduction.pdf
034b0c3bf31120138a6153b7bd28499d *inst/doc/b-simecol-howtos.R
1baec11457784e1880dab76fe40070cd *inst/doc/b-simecol-howtos.Rnw
78bb765c9e20c7aa56060434eb22cbf7 *inst/doc/b-simecol-howtos.pdf
fcd9d9a5955c9a9fb4a9a5bb11508a81 *inst/doc/b-simecol-howtos.pdf
83486c3a764fd74472c7fd81b22c82c1 *inst/doc/examples/CA.R
892fa7f751313ae0d3c6d35533fd145a *inst/doc/examples/chemostat.R
751963265a6ee8128dd653cd3345c148 *inst/doc/examples/competition.R
d5bf6fd6e96e42f42232eb11d1a1b5f5 *inst/doc/examples/conway.R
c308ab7633abd778d3f8fbec0545fda8 *inst/doc/examples/diffusion_A.R
00e89beee89f984cd93c9dd0820d114e *inst/doc/examples/diffusion_B.R
7e1f3aea7a19111e28733560c91b6e6f *inst/doc/examples/diffusion_barrier.R
7170e1941d7668184bd7317eded7f31f *inst/doc/examples/dynload/clotka.c
aacf0a7e33966588ce15c7484fbd9ba8 *inst/doc/examples/dynload/simecol_clotka.R
9872804a6b014f79f2a869144d45d287 *inst/doc/examples/dynload/test_clotka.R
Expand All @@ -59,17 +61,16 @@ cda04e1980cb25aad2c8cad977991b8a *inst/doc/examples/lv3_approxfun.R
984674fbf5bf070e681edae588bb7165 *inst/doc/examples/stoch_ca.R
bd870526f1934004dea1e3f56691274f *inst/doc/examples/stoch_ca_simple.R
129ea95b94f2f2614ac306ab3f5ec578 *inst/doc/examples/upca.R
8841865a3d9897fc8c7f1e92b9a78d38 *inst/doc/index.html
9096a9f825108963524fa589d7cdcccb *man/CA.Rd
0b2b961992821bee7634f843d1c3d2af *man/addtoenv.Rd
5644f692a8c368bce6ce054554af691a *man/approxTime.Rd
fcc8075b0a4d95c97bb84c027840c1d5 *man/as.simObj.Rd
4180668eb25303c5fb258a7a4a3ff817 *man/chemostat.Rd
685624700f0040ecc7bdf5b2177a8d31 *man/conway.Rd
5cb6ed5ff05e3181a6744cb5b21e7e38 *man/conway.Rd
08c8bf095c6932874a918f99dacc38f2 *man/diffusion.Rd
9ef15ca58ef8acb35a877ea9932120d6 *man/eightneighbours.Rd
7b25bfa9a310376d40b5c8e1356a9d98 *man/fitOdeModel.Rd
fd1a0dc0500b6594a3285a413c60cbab *man/fixParms.Rd
5d0b9948faa2d20b7fece785fcdbc404 *man/fixParms.Rd
223fa3d2fd5e838851e5204462ada3c3 *man/fromtoby.Rd
a0462917439624aa4dfd41b32857cd7f *man/initialize-methods.Rd
cf32da08bc43bb6421d89148166b1ab3 *man/iteration.Rd
Expand All @@ -86,20 +87,19 @@ b86f9eb9f0139c08c33f96a36e7703c3 *man/observer.Rd
c701f7bdb286ad8bb9e9e32796864784 *man/peaks.Rd
5969564daf4bf7e85b8ec3e031276b92 *man/plot-methods.Rd
44f62c2ed97bfd153793001f710752a3 *man/print-methods.Rd
bf2e07efb24692587495ff1580aff6ff *man/sEdit.Rd
3459973e81fb331063c6dba465dd1018 *man/sEdit.Rd
789954f2a7450fff9fcf79b5039b4625 *man/seedfill.Rd
2197ffaa539b0dd623b33d3c9399f8c1 *man/sim.Rd
975d2fafe4429c1650454f2b3a55bb9d *man/simecol-package.Rd
2a5b3b01c27548fed3d7d193be73bf32 *man/simecol-package.Rd
7ff6ad207a771c0444348d720e4d620b *man/ssqOdeModel.Rd
03e25c81b8ebbdda2e06feaac20f8700 *man/upca.Rd
0086f13cf0ebc80f89be54e01fd732a5 *src/simecol.c
bc595de111a1e74bea5b3add648704c9 *vignettes/a-simecol-introduction.Rnw
aa0ef034e0eaa221822d5aa0f11edd27 *vignettes/a-simecol-introduction.Rnw
717cb53b4323c7ff0cf7f675b11dfe05 *vignettes/a4wide.sty
1baec11457784e1880dab76fe40070cd *vignettes/b-simecol-howtos.Rnw
686accaa04554feffe53df74eb20b150 *vignettes/ca.pdf
c6f3372e18710befc0fe7a9a52f634f2 *vignettes/classes.pdf
9209c621fdf948216c788a7ec475ab9a *vignettes/ibm_daphnia.R
8841865a3d9897fc8c7f1e92b9a78d38 *vignettes/index.html
7bad89cd1eced44bea3e694baff593ef *vignettes/simecol.bib
ef54f962d5fafb824d423cb4614ec3bd *vignettes/simecol.bib
14418b0d96975e8c5c43bc307d974afd *vignettes/statespace.pdf
f4f34f0b1d26dd6db059faefebb64ab9 *vignettes/vignette.cls
66 changes: 33 additions & 33 deletions R/approxTime1.R
@@ -1,33 +1,33 @@
## special versions of approx:
## approxTime: interpolation of complete rows of a matrix or data frame
## approxTime1: special case with one row only (slightly faster)

approxTime1 <- function (x, xout, rule = 1) {
if (!is.matrix(x)) x <- as.matrix(x)
if ((!is.numeric(xout)) | (length(xout) != 1))
stop("xout must be a scalar numeric value")
if ((!is.numeric(rule)) | (length(rule) != 1))
stop("rule must be a scalar numeric value")

n <- nrow(x)
if (xout >= x[n, 1]) {
y <- c(xout, x[n, -1])
if (rule == 1 & (xout > x[n + 1]))
y[2:length(y)] <- NA
}
else if (xout <= x[1, 1]) {
y <- c(xout, x[1, -1])
if (rule == 1 & (xout < x[1]))
y[2:length(y)] <- NA
}
else {
i <- which.max(x[, 1] > xout)
x1 <- x[i - 1, 1]
x2 <- x[i, 1]
y1 <- x[i - 1, ]
y2 <- x[i, ]
y <- y1 + (y2 - y1) * (xout - x1)/(x2 - x1)
}
names(y) <- dimnames(x)[[2]]
y
}
## special versions of approx:
## approxTime: interpolation of complete rows of a matrix or data frame
## approxTime1: special case with one row only (slightly faster)

approxTime1 <- function (x, xout, rule = 1) {
if (!is.matrix(x)) x <- as.matrix(x)
if ((!is.numeric(xout)) | (length(xout) != 1))
stop("xout must be a scalar numeric value")
if ((!is.numeric(rule)) | (length(rule) != 1))
stop("rule must be a scalar numeric value")

n <- nrow(x)
if (xout >= x[n, 1]) {
y <- c(xout, x[n, -1])
if (rule == 1 & (xout > x[n + 1]))
y[2:length(y)] <- NA
}
else if (xout <= x[1, 1]) {
y <- c(xout, x[1, -1])
if (rule == 1 & (xout < x[1]))
y[2:length(y)] <- NA
}
else {
i <- which.max(x[, 1] > xout)
x1 <- x[i - 1, 1]
x2 <- x[i, 1]
y1 <- x[i - 1, ]
y2 <- x[i, ]
y <- y1 + (y2 - y1) * (xout - x1)/(x2 - x1)
}
names(y) <- dimnames(x)[[2]]
y
}
34 changes: 17 additions & 17 deletions R/sEdit.R
Expand Up @@ -31,46 +31,46 @@ sEdit <- function(x, title="Please enter values:") {
build <- function(slot) {
ret <- character(length(slot))
for (i in 1:length(slot)) {
ret[i] <- tclvalue(row.names[i])
ret[i] <- tcltk::tclvalue(row.names[i])
}
ret
}
reset <- function() {
for (i in 1:length(slot)) {
tclvalue(row.names[i]) <- slot[i]
tcltk::tclvalue(row.names[i]) <- slot[i]
}
}
## create dialog box
tt <- tktoplevel()
tkwm.title(tt,title)
tt <- tcltk::tktoplevel()
tcltk::tkwm.title(tt,title)
entries <- as.list(slot)
row.names <- names(slot)
if (is.null(row.names)) {
row.names <- paste("var",1:length(slot),sep="")
}
for (i in 1:length(slot)) {
entries[[i]] <- tkentry(tt, textvariable=row.names[i])
tkgrid(tklabel(tt,text=row.names[i]), entries[[i]])
entries[[i]] <- tcltk::tkentry(tt, textvariable=row.names[i])
tcltk::tkgrid(tcltk::tklabel(tt,text=row.names[i]), entries[[i]])
}
reset.but <- tkbutton(tt, text="Reset", command=reset)
submit.but <- tkbutton(tt, text="OK",
command=function()tclvalue(done) <- 1)
tkgrid(reset.but, submit.but)
done <- tclVar(0)
reset.but <- tcltk::tkbutton(tt, text="Reset", command=reset)
submit.but <- tcltk::tkbutton(tt, text="OK",
command=function()tcltk::tclvalue(done) <- 1)
tcltk::tkgrid(reset.but, submit.but)
done <- tcltk::tclVar(0)
## capture destroy event
tkbind(tt, "<Destroy>", function()tclvalue(done) <- 2)
tcltk::tkbind(tt, "<Destroy>", function()tcltk::tclvalue(done) <- 2)
## initialize with oiginal slot values
reset()
tkwm.deiconify(tt) # raise the tk window
tkwait.variable(done)
if(tclvalue(done)=="2") stop("dialog cancelled")
tkdestroy(tt)
tcltk::tkwm.deiconify(tt) # raise the tk window
tcltk::tkwait.variable(done)
if(tcltk::tclvalue(done)=="2") stop("dialog cancelled")
tcltk::tkdestroy(tt)
ret <- build(slot)
names(ret) <- names(slot) # restore original names
ret
}
## -------------- main ----------------
tcltk <- require("tcltk", quietly=TRUE)
tcltk <- requireNamespace("tcltk", quietly = TRUE)
if (is.vector(x) & !is.list(x) & (tcltk)) {
## slot is a vector
ret <- editVec(x)
Expand Down
Binary file modified build/vignette.rds
Binary file not shown.
Binary file modified data/CA.rda
Binary file not shown.
Binary file modified data/chemostat.rda
Binary file not shown.
Binary file modified data/conway.rda
Binary file not shown.
Binary file modified data/diffusion.rda
Binary file not shown.
Binary file modified data/lv.rda
Binary file not shown.
Binary file modified data/lv3.rda
Binary file not shown.
Binary file modified data/upca.rda
Binary file not shown.
9 changes: 9 additions & 0 deletions inst/NEWS
@@ -1,3 +1,12 @@
0.8-6
o use tcltk::-calls
o enable automatic vignette index
o add new model "diffusion_barrier.R" to doc/examples

0.8-5
o requireNamespace instead of require for tcltk


0.8-4
o addtoenv for parameters
(experimental and only for class indbasedModel)
Expand Down

0 comments on commit 3572d08

Please sign in to comment.