文書の過去の版を表示しています。


時間計画保全のマルコフ決定過程による表現

年齢取替の行動の状態遷移行列

mmdp_create.ageing.matrix = function(S) {
  R = max(S)-min(S)
  n = length(S)
  if( R != n-1 ) {
    stop("age space is not regular and/or does not begin with 0.")
  }
  max.S = max(S)
  P = rbind(cbind(0,diag(rep(1,max.S))),0)
  P[max.S+1,max.S+1] = 1
  rownames(P)=S
  colnames(P)=S
  return(P)
}

故障状態になったら強制的に緊急取替を行う状態遷移行列。

P.Dgr = matrix(c(
  9/10, 1/10, 0, 0, 0,
  0, 9/10, 1/10, 0, 0,
  0, 0, 9/10, 1/10, 0,
  0, 0, 0, 9/10, 1/10,
  1, 0, 0, 0, 0), nrow=5, ncol=5, byrow=TRUE)
rownames(P.Dgr) = c(0:4)
colnames(P.Dgr) = c(0:4)
P.Dgr

その費用関数

C.Opr.Dgr = c(0,0,0,0,2000)

残りのコード。

S.Dgr = c(0:4)
S.Age = c(0:10)
P.Dgr = matrix(c(
  9/10, 1/10, 0, 0, 0,
  0, 9/10, 1/10, 0, 0,
  0, 0, 9/10, 1/10, 0,
  0, 0, 0, 9/10, 1/10,
  1, 0, 0, 0, 0), nrow=5, ncol=5, byrow=TRUE)
rownames(P.Dgr) = c(0:4)
colnames(P.Dgr) = c(0:4)
P.Age = mmdp_create.ageing.matrix(S.Age)
P.Hrd = mmdp_create.age.replacement.matrix(S.Age,4)
P.Dgr.2 = mmdp_expand.P.2(list(P.Dgr,P.Age))
P.Hrd.2 = mmdp_expand.P.2(list(mmdp_create.replacement.matrix(S.Dgr),P.Hrd))
P = array(0,dim=c(dim(P.Dgr.2)[1],dim(P.Dgr.2)[2],2))
P[,,1] = P.Dgr.2
P[,,2] = P.Hrd.2
C.Opr.Dgr = c(0,0,0,0,2000)
C.Opr.Age = rep(0,11)
C.Rpl.Dgr = c(150,150,150,150,150)
C.Rpl.Age = rep(0,11)
C.Opr.Opr = mmdp_expand.R.2(list(C.Opr.Dgr,C.Opr.Age))
C.Rpl.Rpl = mmdp_expand.R.2(list(C.Rpl.Dgr,C.Rpl.Age))
Cost = cbind(C.Opr.Opr,C.Rpl.Rpl)
R = -Cost

年齢が6になったら、交換を行うという保全基準の方策

cbind(expand.grid(c(0:4),c(0:10)),c(rep(1,5*6),rep(2,5*5)))

反復によって総機体割引き費用を求める。

mdp_eval_policy_iterative(P,R,0.95,c(rep(1,5*6),rep(2,5*5)))

一方で、価値反復法によって、故障したら事後取替、そして予防取替、の2つの最適な方策を求めてみると。

mdp_value_iteration(P,R,0.95)