convertBinary2HMP: Convert a HMDP model stored in binary format to a hmp (xml)...

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

View source: R/convertBinary2HMP.R

Description

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 hmpMDPWriter.

Usage

1
2
3
  convertBinary2HMP(prefix="",
    binNames=c("stateIdx.bin","stateIdxLbl.bin","actionIdx.bin","actionIdxLbl.bin","actionWeight.bin","actionWeightLbl.bin","transProb.bin"),
    out=paste(prefix,'converted.hmp',sep=""), duration=1)

Arguments

prefix

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

binNames

A character vector of length 7 giving the names of the binary files storing the model.

out

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

duration

Weight number storing the duration (NULL if none).

Value

NULL (invisible).

Note

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

Author(s)

Lars Relund lars@relund.dk

See Also

convertHMP2Binary.

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 convertBinary2HMP in MDP...