{
  "_id": "6a498d056d67900babdfabec",
  "Type": "Package",
  "Package": "MDP2",
  "Title": "Markov Decision Processes (MDPs)",
  "Version": "3.0.0",
  "Authors@R": "c(\nperson(\"Lars\", \"Relund Nielsen\", , \"lars@relund.dk\", role = c(\"aut\", \"cre\"),\ncomment = c(ORCID = \"0000-0002-4802-3071\")))",
  "Author": "Lars Relund Nielsen [aut, cre]\n(<https://orcid.org/0000-0002-4802-3071>)",
  "Maintainer": "Lars Relund Nielsen <lars@relund.dk>",
  "Description": "Create and optimize (semi) MDPs with discrete time steps\nand state space. Both hierarchical and ordinary-traditional\nMDPs can be modeled.",
  "License": "GPL (>= 3)",
  "URL": "https://relund.github.io/mdp/, https://github.com/relund/mdp/,\nhttp://relund.github.io/mdp/",
  "BugReports": "https://github.com/relund/mdp/issues",
  "VignetteBuilder": "knitr",
  "Encoding": "UTF-8",
  "Language": "en-US",
  "Roxygen": "list(markdown = TRUE)",
  "Config/roxygen2/version": "8.0.0",
  "Config/testthat/edition": "3",
  "Config/pak/sysreqs": "libicu-dev",
  "Repository": "https://relund.r-universe.dev",
  "Date/Publication": "2026-06-22 07:44:41 UTC",
  "RemoteUrl": "https://github.com/relund/mdp",
  "RemoteRef": "HEAD",
  "RemoteSha": "ade64bc9310f6737e537725e1685dd316bb01dd3",
  "NeedsCompilation": "yes",
  "Packaged": {
    "Date": "2026-06-22 09:36:51 UTC",
    "User": "root"
  },
  "_user": "relund",
  "_type": "src",
  "_file": "MDP2_3.0.0.tar.gz",
  "_fileid": "https://r2.ropensci.org/30a64d84c77655fed62f6abfdc77b07e688b3ba4dd84b4272f260c73c92122a1",
  "_filesize": 3124910,
  "_sha256": "30a64d84c77655fed62f6abfdc77b07e688b3ba4dd84b4272f260c73c92122a1",
  "_expires": "2026-10-12T22:45:23.000Z",
  "_created": "2026-06-22T09:36:51.000Z",
  "_published": "2026-07-04T22:45:25.646Z",
  "_jobs": [
    {
      "job": 85173180897,
      "time": 163,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7788559231"
    },
    {
      "job": 85173180735,
      "time": 174,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7788562223"
    },
    {
      "job": 85173180875,
      "time": 171,
      "config": "linux-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7788562591"
    },
    {
      "job": 85173180854,
      "time": 185,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7788566013"
    },
    {
      "job": 85173180751,
      "time": 144,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7788636297"
    },
    {
      "job": 85173180896,
      "time": 346,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7788670083"
    },
    {
      "job": 85173180879,
      "time": 182,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7788691972"
    },
    {
      "job": 85173180884,
      "time": 384,
      "config": "macos-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7788684373"
    },
    {
      "job": 85173180688,
      "time": 250,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7788495405"
    },
    {
      "job": 85173180761,
      "time": 123,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "FAIL",
      "artifact": ""
    },
    {
      "job": 85173180714,
      "time": 172,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7788561956"
    },
    {
      "job": 85173180885,
      "time": 158,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7788556468"
    },
    {
      "job": 85173180887,
      "time": 113,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7788540129"
    }
  ],
  "_host": "GitHub-Actions",
  "_buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447",
  "_status": "success",
  "_upstream": "https://github.com/relund/mdp",
  "_commit": {
    "id": "ade64bc9310f6737e537725e1685dd316bb01dd3",
    "author": "Lars Relund <jund@relund.dk>",
    "committer": "Lars Relund <jund@relund.dk>",
    "message": "Update package\n",
    "time": 1782114281
  },
  "_maintainer": {
    "name": "Lars Relund Nielsen",
    "email": "lars@relund.dk",
    "orcid": "0000-0002-4802-3071"
  },
  "_distro": "noble",
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 4.1.0",
      "role": "Depends"
    },
    {
      "package": "Rcpp",
      "role": "LinkingTo"
    },
    {
      "package": "RcppArmadillo",
      "role": "LinkingTo"
    },
    {
      "package": "diagram",
      "role": "Imports"
    },
    {
      "package": "dplyr",
      "role": "Imports"
    },
    {
      "package": "stringr",
      "role": "Imports"
    },
    {
      "package": "tidyr",
      "role": "Imports"
    },
    {
      "package": "magrittr",
      "role": "Imports"
    },
    {
      "package": "methods",
      "role": "Imports"
    },
    {
      "package": "purrr",
      "role": "Imports"
    },
    {
      "package": "rlang",
      "role": "Imports"
    },
    {
      "package": "tibble",
      "role": "Imports"
    },
    {
      "package": "Rcpp",
      "version": ">= 0.11.5",
      "role": "Imports"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "Matrix",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    },
    {
      "package": "readr",
      "role": "Suggests"
    },
    {
      "package": "xml2",
      "role": "Suggests"
    },
    {
      "package": "covr",
      "role": "Suggests"
    },
    {
      "package": "roxygen2",
      "role": "Suggests"
    }
  ],
  "_owner": "relund",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2026-19",
      "n": 1
    },
    {
      "week": "2026-21",
      "n": 9
    },
    {
      "week": "2026-22",
      "n": 3
    },
    {
      "week": "2026-23",
      "n": 17
    },
    {
      "week": "2026-26",
      "n": 1
    }
  ],
  "_tags": [
    {
      "name": "2.2.2.0",
      "date": "2026-06-05"
    }
  ],
  "_stars": 2,
  "_contributors": [
    {
      "user": "relund",
      "count": 116,
      "uuid": 887198
    }
  ],
  "_userbio": {
    "uuid": 887198,
    "type": "user",
    "name": "Lars Relund ",
    "followers": 4
  },
  "_downloads": {
    "count": 209,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/MDP2"
  },
  "_devurl": "https://github.com/relund/mdp",
  "_pkgdown": "https://relund.github.io/mdp/",
  "_searchresults": 41,
  "_topics": [
    "openblas",
    "cpp"
  ],
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/MDP2.html",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/relund/mdp",
  "_realowner": "relund",
  "_cranurl": true,
  "_releases": [
    {
      "version": "2.1.2",
      "date": "2023-01-31"
    },
    {
      "version": "2.2.2.0",
      "date": "2026-06-12"
    }
  ],
  "_exports": [
    "binary_action_writer",
    "binary_mdp_writer",
    "convert_binary_to_hmp",
    "convert_hmp_to_binary",
    "get_bin_info_actions",
    "get_bin_info_states",
    "get_hypergraph",
    "get_info",
    "get_policy",
    "get_rpo",
    "get_steady_state_pr",
    "get_w_idx",
    "hmp_mdp_writer",
    "load_mdp",
    "memory_mdp_writer",
    "plot_hypergraph",
    "random_hmdp",
    "run_calc_weights",
    "run_policy_ite_ave",
    "run_policy_ite_discount",
    "run_value_ite",
    "save_mdp",
    "set_policy"
  ],
  "_help": [
    {
      "page": "binary_action_writer",
      "title": "Function for writing actions of a HMDP model to binary files. The function defines sub-functions which can be used to define actions saved in a set of binary files. It is assumed that the states have been defined using 'binary_mdp_writer' and that the id of the states is known (can be retrieved using e.g. 'state_idx_df').",
      "topics": [
        "binary_action_writer"
      ]
    },
    {
      "page": "binary_mdp_writer",
      "title": "Function for writing an HMDP model to binary files. The function defines sub-functions which can be used to define an HMDP model saved in a set of binary files.",
      "topics": [
        "binary_mdp_writer"
      ]
    },
    {
      "page": "convert_binary_to_hmp",
      "title": "Convert a HMDP model stored in binary format to a 'hmp' (XML) file. The function simply parse the binary files and create 'hmp' files using the 'hmp_mdp_writer()'.",
      "topics": [
        "convert_binary_to_hmp"
      ]
    },
    {
      "page": "convert_hmp_to_binary",
      "title": "Convert a HMDP model stored in a hmp (xml) file to binary file format.",
      "topics": [
        "convert_hmp_to_binary"
      ]
    },
    {
      "page": "get_bin_info_actions",
      "title": "Info about the actions in the HMDP model under consideration.",
      "topics": [
        "get_bin_info_actions"
      ]
    },
    {
      "page": "get_bin_info_states",
      "title": "Info about the states in the binary files of the HMDP model under consideration.",
      "topics": [
        "get_bin_info_states"
      ]
    },
    {
      "page": "get_hypergraph",
      "title": "Return the (parts of) state-expanded hypergraph",
      "topics": [
        "get_hypergraph"
      ]
    },
    {
      "page": "get_info",
      "title": "Information about the MDP",
      "topics": [
        "get_info"
      ]
    },
    {
      "page": "get_policy",
      "title": "Get parts of the optimal policy.",
      "topics": [
        "get_policy"
      ]
    },
    {
      "page": "get_rpo",
      "title": "Calculate the retention pay-off (RPO) or opportunity cost for some states.",
      "topics": [
        "get_rpo"
      ]
    },
    {
      "page": "get_steady_state_pr",
      "title": "Calculate the steady state transition probabilities for the founder process (level 0).",
      "topics": [
        "get_steady_state_pr"
      ]
    },
    {
      "page": "get_w_idx",
      "title": "Return the index of a weight in the model. Note that index always start from zero (C++ style), i.e. the first weight, the first state at a stage etc has index 0.",
      "topics": [
        "get_w_idx"
      ]
    },
    {
      "page": "hmp_mdp_writer",
      "title": "Function for writing an HMDP model to a hmp file (XML). The function define sub-functions which can be used to define an HMDP model stored in a hmp file.",
      "topics": [
        "hmp_mdp_writer"
      ]
    },
    {
      "page": "load_mdp",
      "title": "Load the HMDP model defined in the binary files. The model are created in memory using the external C++ library.",
      "topics": [
        "load_mdp"
      ]
    },
    {
      "page": "memory_mdp_writer",
      "title": "Function for building an HMDP model directly in memory.",
      "topics": [
        "memory_mdp_writer"
      ]
    },
    {
      "page": "plot_hypergraph",
      "title": "Plot parts of the state expanded hypergraph.",
      "topics": [
        "plot_hypergraph"
      ]
    },
    {
      "page": "plot.HMDP",
      "title": "Plot the state-expanded hypergraph of the MDP.",
      "topics": [
        "plot.HMDP"
      ]
    },
    {
      "page": "random_hmdp",
      "title": "Generate a \"random\" HMDP stored in a set of binary files.",
      "topics": [
        "random_hmdp"
      ]
    },
    {
      "page": "run_calc_weights",
      "title": "Calculate weights based on current policy. Normally run after an optimal policy has been found.",
      "topics": [
        "run_calc_weights"
      ]
    },
    {
      "page": "run_policy_ite_ave",
      "title": "Perform policy iteration using the average expected-weight Bellman operator on the MDP.",
      "topics": [
        "run_policy_ite_ave"
      ]
    },
    {
      "page": "run_policy_ite_discount",
      "title": "Perform policy iteration using the discounted expected-weight Bellman operator on the MDP.",
      "topics": [
        "run_policy_ite_discount"
      ]
    },
    {
      "page": "run_value_ite",
      "title": "Perform value iteration on the MDP.",
      "topics": [
        "run_value_ite"
      ]
    },
    {
      "page": "save_mdp",
      "title": "Save the MDP to binary files",
      "topics": [
        "save_mdp"
      ]
    },
    {
      "page": "set_policy",
      "title": "Modify the current policy by setting policy action of states.",
      "topics": [
        "set_policy"
      ]
    }
  ],
  "_readme": "https://github.com/relund/mdp/raw/HEAD/README.md",
  "_rundeps": [
    "cli",
    "cpp11",
    "diagram",
    "dplyr",
    "generics",
    "glue",
    "lifecycle",
    "magrittr",
    "pillar",
    "pkgconfig",
    "purrr",
    "R6",
    "Rcpp",
    "RcppArmadillo",
    "rlang",
    "shape",
    "stringi",
    "stringr",
    "tibble",
    "tidyr",
    "tidyselect",
    "utf8",
    "vctrs",
    "withr"
  ],
  "_sysdeps": [
    {
      "shlib": "liblapack",
      "package": "libopenblas0-pthread",
      "source": "openblas",
      "version": "0.3.26+ds-1ubuntu0.1",
      "name": "openblas",
      "homepage": "https://www.openblas.net/",
      "description": "Optimized BLAS (linear algebra) library (shared lib, pthread)"
    },
    {
      "shlib": "libstdc++",
      "package": "libstdc++6",
      "source": "gcc",
      "version": "14.2.0-4ubuntu2~24.04.1",
      "name": "c++",
      "homepage": "http://gcc.gnu.org/",
      "description": "GNU Standard C++ Library v3"
    }
  ],
  "_vignettes": [
    {
      "source": "building.Rmd",
      "filename": "building.html",
      "title": "Building an MDP model",
      "author": "Lars Relund lars@relund.dk",
      "engine": "knitr::rmarkdown",
      "headings": [
        "An infinite semi-MDP",
        "A finite-horizon semi-MDP",
        "An infinite-horizon HMDP",
        "References"
      ],
      "created": "2023-01-27 10:21:39",
      "modified": "2026-06-04 12:53:36",
      "commits": 5
    },
    {
      "source": "finite-mdp.Rmd",
      "filename": "finite-mdp.html",
      "title": "Solving a finite-horizon semi-MDP",
      "author": "Lars Relund lars@relund.dk",
      "engine": "knitr::rmarkdown",
      "headings": [
        "A finite-horizon semi-MDP",
        "Example",
        "References"
      ],
      "created": "2023-01-27 10:21:39",
      "modified": "2026-06-04 12:53:36",
      "commits": 3
    },
    {
      "source": "infinite-hmdp.Rmd",
      "filename": "infinite-hmdp.html",
      "title": "An infinite-horizon HMDP",
      "author": "Lars Relund lars@relund.dk",
      "engine": "knitr::rmarkdown",
      "headings": [
        "An infinite-horizon HMDP",
        "Example",
        "References"
      ],
      "created": "2023-01-27 10:21:39",
      "modified": "2026-06-04 12:53:36",
      "commits": 4
    },
    {
      "source": "infinite-mdp.Rmd",
      "filename": "infinite-mdp.html",
      "title": "Solving an infinite-horizon semi-MDP",
      "author": "Lars Relund lars@relund.dk",
      "engine": "knitr::rmarkdown",
      "headings": [
        "An infinite-horizon semi-MDP",
        "Example",
        "References"
      ],
      "created": "2023-01-27 10:21:39",
      "modified": "2026-06-04 12:53:36",
      "commits": 5
    },
    {
      "source": "mdp2.Rmd",
      "filename": "mdp2.html",
      "title": "The MDP2 package",
      "author": "Lars Relund lars@relund.dk",
      "engine": "knitr::rmarkdown",
      "headings": [
        "References"
      ],
      "created": "2022-12-16 13:33:24",
      "modified": "2026-06-04 12:53:36",
      "commits": 7
    }
  ],
  "_score": 6.010723865391773,
  "_indexed": true,
  "_nocasepkg": "mdp2",
  "_universes": [
    "relund"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "3.0.0",
      "date": "2026-06-22T09:39:29.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/b6cb19e190391bdbf3ac652fa354e23e814e97b0d1968752d3939c45a4d4d714",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "3.0.0",
      "date": "2026-06-22T09:39:35.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/7fc82694d7115c7daec9552951881b17223b7423beb53e37cfdadab6cd850014",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "3.0.0",
      "date": "2026-06-22T09:39:37.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/6807da70472bbede74ce8854680697218e9d8c6d1b46a56a346203635be2549d",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "3.0.0",
      "date": "2026-06-22T09:39:41.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/cbad9e5ac3ed8995701b5979d233d8682191d7d5c4e94c288cba7847b7d6c29c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "3.0.0",
      "date": "2026-06-22T09:43:02.000Z",
      "arch": "aarch64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/4a6b615785b410ba978a2536f73545cfc843e582d62b5fdf199f3126dde0b05a",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "3.0.0",
      "date": "2026-06-22T09:43:23.000Z",
      "arch": "x86_64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/7d6f497cc4de86139edc11810ff63c762b9d08da838502e58e12daec6d3426a4",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "3.0.0",
      "date": "2026-06-22T09:45:04.000Z",
      "arch": "aarch64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/2a6b6f3075dbc615357640cb2877fd17f85306c7f781fb845a9f7feb2518e942",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "3.0.0",
      "date": "2026-06-22T09:43:51.000Z",
      "arch": "x86_64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/9520b60471735d6e18528fcc47a819cf1710d87ac4a8a5039f61d32733a40d96",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "3.0.0",
      "date": "2026-06-22T09:38:44.000Z",
      "arch": "x86_64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/791a2f31b5b354303be76d39fe13713148d6439efafa8b059547f285719f9442",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "3.0.0",
      "date": "2026-06-22T09:38:41.000Z",
      "arch": "x86_64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/c3610f785e3ad868ac1fe95cbe0089c395f4ba64c053138beec2e23fb1710f79",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "3.0.0",
      "date": "2026-06-22T09:38:26.000Z",
      "arch": "x86_64",
      "commit": "ade64bc9310f6737e537725e1685dd316bb01dd3",
      "fileid": "https://r2.ropensci.org/c0d76732f46c53c055d6226da53f7599301ca633856c226c9f704594c948acda",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27943270447"
    }
  ]
}