Description Usage Arguments Value Note Author(s) See Also Examples
View source: R/convertBinary2HMP.R
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.
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)
|
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). |
NULL (invisible).
Note all indexes are starting from zero (C/C++ style).
Lars Relund lars@relund.dk
convertHMP2Binary.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.