Yearly Archives: 2009

12 posts

How to replace cows optimally

The 16th of October I gave a presentation to a group of students at KU Life about optimal replacement policies for dairy cows based on daily yield measurements. A hierarchical Markov decision process is used to solve the problem. The following downloads are available: presentation – handouts (2×2) – animation 1 2 3


Erratum to “An algorithm for ranking assignments using reoptimization” [Computers and Operations Research 35 (2008) 3714-3726] is now available on-line. As pointed out by Dr. A. Volgenant, we unfortunately missed one available implementation written by Miller et al. in IEEE Transactions on Aerospace and Electronic Systems.

Accessing an array created in R from C++

Assume that you have created a 3-dim array in R containing vectors of various size: > a<-array(list(),c(2,2,2))   # array where each element contain a numeric vector > a[[1,1,1]]<-rnorm(1) > a[[1,1,2]]<-rnorm(3) > a[[2,1,1]]<-rnorm(2) > a[[2,1,2]]<-rnorm(3) > a[[1,2,1]]<-rnorm(4) > a[[1,2,2]]<-rnorm(3) > a[[2,2,1]]<-rnorm(5) > a[[2,2,2]]<-rnorm(1) > d = dim(a) > d [1] 2 2 2 > i<-1; j<-1; k<-2 > q<-i + j*d[1] + k*(d[1]*d[2]) – (d[1] + d[1]*d[2]) > a[[i,j,k]]      # access an element [1] -0.2370040 -0.6009635  3.0550405 > a[[q]]          # access the same element using a single index [1] -0.2370040 -0.6009635  3.0550405 Note you can access the array in two ways. Next you want to copy the array to a vector on the C++ side. For instance in a package you may need to do some operations in C++ to speed up time. On the C++ side you can create a function:

EURO Summer Institute 2009 (ESI 2009)

Aim of ESI 2009 is to bring together young scientists with academic experts on OR methods besides the development of applications for Agriculture, Forestry and related industries of the primary sector. Anders Ringgaard Kristensen and I will the first day talk about Markov decision processes (MDPs) for sequential decision problems in agriculture and forestry. First the theory of MDPs will be presented and next I will give an introduction to my new MDP package in R. The files needed for the exercises can be found here.

Optimering af foderplanlægning med NorFor Plan

NorFor Plan, der er et system til rationsoptimering, inddrager ikke de økonomiske sammenhænge på den enkelte bedrift og dermed optimering af fodringsøkonomien i den enkelte besætning. Økonomisk optimering er vigtig i en tid, hvor der er stigende fokusering på effektivisering i malkekvægsbesætninger og større udsving i priser på foder og mælk. I 2008 har jeg været involveret i et udredningsarbejde, som skulle opstille en anbefaling for udvikling af et beslutningsstøtteværktøj til økonomisk foderoptimering i den enkelte besætning baseret på NorFor Plan. Resultatet af arbejdet er en intern rapport.