{
  "_id": "6a2d2ef13efcd9bda42fa810",
  "Type": "Package",
  "Package": "MDP2",
  "Title": "Markov Decision Processes (MDPs)",
  "Version": "2.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-05 06:26:50 UTC",
  "RemoteUrl": "https://github.com/relund/mdp",
  "RemoteRef": "HEAD",
  "RemoteSha": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
  "NeedsCompilation": "yes",
  "Packaged": {
    "Date": "2026-06-13 10:12:37 UTC",
    "User": "root"
  },
  "MD5sum": "079ca2c68d2eca8167c5f1ae0a4bed05",
  "_user": "relund",
  "_type": "src",
  "_file": "MDP2_2.3.0.0.tar.gz",
  "_fileid": "da787f928b3f10868eabda75e2e36b4683481f60989d9376eae57044da18285c",
  "_filesize": 3124912,
  "_sha256": "da787f928b3f10868eabda75e2e36b4683481f60989d9376eae57044da18285c",
  "_created": "2026-06-13T10:12:37.000Z",
  "_published": "2026-06-13T10:20:33.223Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 81182558848,
      "time": 170,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7609844146"
    },
    {
      "job": 81182558854,
      "time": 181,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7609845608"
    },
    {
      "job": 81182558860,
      "time": 165,
      "config": "linux-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7609843611"
    },
    {
      "job": 81182558846,
      "time": 174,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7609845651"
    },
    {
      "job": 81182558857,
      "time": 162,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7609840456"
    },
    {
      "job": 81182558843,
      "time": 414,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7609867614"
    },
    {
      "job": 81182558864,
      "time": 233,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7609847464"
    },
    {
      "job": 81182558855,
      "time": 271,
      "config": "macos-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7609853299"
    },
    {
      "job": 81182329727,
      "time": 242,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7609824769"
    },
    {
      "job": 81182558825,
      "time": 123,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "FAIL",
      "artifact": ""
    },
    {
      "job": 81182558847,
      "time": 149,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7609841733"
    },
    {
      "job": 81182558835,
      "time": 155,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7609842405"
    },
    {
      "job": 81182558836,
      "time": 139,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7609840662"
    }
  ],
  "_buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/relund/mdp",
  "_commit": {
    "id": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
    "author": "Lars Relund <jund@relund.dk>",
    "committer": "Lars Relund <jund@relund.dk>",
    "message": "New snake case api\n",
    "time": 1780640810
  },
  "_maintainer": {
    "name": "Lars Relund Nielsen",
    "email": "lars@relund.dk",
    "orcid": "0000-0002-4802-3071"
  },
  "_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
    }
  ],
  "_tags": [],
  "_stars": 2,
  "_contributors": [
    {
      "user": "relund",
      "count": 116,
      "uuid": 887198
    }
  ],
  "_userbio": {
    "uuid": 887198,
    "type": "user",
    "name": "Lars Relund "
  },
  "_downloads": {
    "count": 4,
    "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": 5.913813852383717,
  "_indexed": true,
  "_nocasepkg": "mdp2",
  "_universes": [
    "relund"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:15:14.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "371aed5ea32f780de0c81ae6156a7f88cfe7a2b40f0645cbc025dcd0f264f280",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:15:20.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "7d4b07e475911f06145dd3b6d4a34f23649ac754372752c742aa42e8e07be15e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:15:08.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "20f713c3da7674d32f8709d09c8c1e95f5e8f1138480a26fdf3d722aa4e1954e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:15:23.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "100aa167d12c152019118dedece69760c30db0bbf0d32374d08061ae9bf01f3d",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:15:01.000Z",
      "arch": "aarch64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "a7c588d1a474f434caae6c841a9edab89a21eb7c276c63c9fcb7c4bbf329c38c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:17:32.000Z",
      "arch": "x86_64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "d6c1cc03b8e92aed6f573d15729f3789c61041eff2775550b0b254343c7604f4",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:15:29.000Z",
      "arch": "aarch64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "ce18c7a06deea144191c97fb5edcefa6a19cfdd2f1b126c963c773ebd2622f4e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:16:02.000Z",
      "arch": "x86_64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "050bf07c2de2a6fa6a8ffe75354406ba83e593d859324f99d175ad223208f79e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:14:12.000Z",
      "arch": "x86_64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "bed07c7ccfb4486ba745e95deebbe98a5818ceace717aec6df078e7828bdcbd0",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:14:14.000Z",
      "arch": "x86_64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "5f964ec7515e32af03e66515e0d28c69c62cf1e849a1728ea359ff8db54aa5e2",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "2.3.0.0",
      "date": "2026-06-13T10:14:10.000Z",
      "arch": "x86_64",
      "commit": "a22843d0ed33eca9e520a92efcea8371a2dc1d54",
      "fileid": "b3e04acc94eccf3ad14cd4cfa73e079f7d255fcd49a4de1e45170cb8c910a08d",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/relund/actions/runs/27463769837"
    }
  ]
}