public abstract class AbstractModelReader extends Object
| Modifier and Type | Field and Description |
|---|---|
protected DataReader |
dataReader |
protected int |
NUM_PREDS
The number of predicates contained in the model.
|
| Constructor and Description |
|---|
AbstractModelReader(DataReader dataReader) |
AbstractModelReader(File f) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
checkModelType() |
abstract AbstractModel |
constructModel() |
AbstractModel |
getModel() |
protected int[][] |
getOutcomePatterns() |
protected String[] |
getOutcomes() |
protected Context[] |
getParameters(int[][] outcomePatterns)
Reads the parameters from a file and populates an array of context objects.
|
protected String[] |
getPredicates() |
double |
readDouble()
Implement as needed for the format the model is stored in.
|
int |
readInt()
Implement as needed for the format the model is stored in.
|
String |
readUTF()
Implement as needed for the format the model is stored in.
|
protected int NUM_PREDS
protected DataReader dataReader
public AbstractModelReader(File f) throws IOException
IOExceptionpublic AbstractModelReader(DataReader dataReader)
public int readInt()
throws IOException
IOExceptionpublic double readDouble()
throws IOException
IOExceptionpublic String readUTF() throws IOException
IOExceptionpublic AbstractModel getModel() throws IOException
IOExceptionpublic abstract void checkModelType()
throws IOException
IOExceptionpublic abstract AbstractModel constructModel() throws IOException
IOExceptionprotected String[] getOutcomes() throws IOException
IOExceptionprotected int[][] getOutcomePatterns()
throws IOException
IOExceptionprotected String[] getPredicates() throws IOException
IOExceptionprotected Context[] getParameters(int[][] outcomePatterns) throws IOException
outcomePatterns - The outcomes patterns for the model. The first index refers to which
outcome pattern (a set of outcomes that occurs with a context) is being specified. The
second index specifies the number of contexts which use this pattern at index 0, and the
index of each outcomes which make up this pattern in indicies 1-n.IOException - when the model file does not match the outcome patterns or can not be read.Copyright © 2019 The Apache Software Foundation. All rights reserved.