convertHMP2Binary: Convert a HMDP model stored in a hmp (xml) file to binary...

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/convertHMP2Binary.R

Description

The function simply parse the hmp file and create binary files using the binaryMDPWriter.

Usage

1
  convertHMP2Binary(file, prefix = "")

Arguments

file

The name of the hmp file (e.g. mdp.hmp).

prefix

A character string with the prefix which will be added to the binary files.

Value

NULL (invisible).

Note

Note all indexes are starting from zero (C/C++ style).

Author(s)

Lars Relund lars@relund.dk

See Also

binaryMDPWriter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
wDir <- getwd()
setwd(system.file("models", package = "MDP"))

## convert the machine example to a hmp file
prefix1<-"machine1_"
convertBinary2HMP(prefix1, duration=NULL)
# have a look at the hmp file
xmlTreeParse("machine1_converted.hmp",useInternalNodes=TRUE)

## convert the machine example hmp file to binary files
prefix2<-"machine_cov_"
convertHMP2Binary("machine1.hmp",prefix2)
stateIdxDf(prefix1)
stateIdxDf(prefix2)

## convert the machine example with a single dummy node to a hmp file
#convertBinary2HMP("machine2_")  # error since using scope = 3 not supported in hmp files

MDP documentation built on May 2, 2019, 6:48 p.m.

Related to convertHMP2Binary in MDP...