Search in sources :

Example 1 with UAIModelReader

use of com.sri.ai.praise.core.representation.classbased.table.core.uai.parsing.UAIModelReader in project aic-praise by aic-sri-international.

the class AbstractUAI_to_Target_Translator method translate.

// END-Translator
// 
@Override
protected void translate(String inputIdentifier, Reader[] inputModelReaders, PrintWriter[] translatedOutputs) throws Exception {
    Reader uaiModelReader = inputModelReaders[0];
    Reader uaiEvidenceReader = inputModelReaders[1];
    // 
    // Instantiate the source UAI model
    UAIModel uaiModel = UAIModelReader.read(uaiModelReader);
    // 
    // Read the corresponding evidence and merge into the model
    // This is required as the UAI solvers all take the evidence
    // when they are searching for solutions, so other solvers
    // need to have this information contained in their models
    // as well.
    UAIEvidenceReading.read(uaiEvidenceReader, uaiModel);
    uaiModel.mergeEvidenceIntoModel();
    translate(inputIdentifier, uaiModel, translatedOutputs);
}
Also used : UAIModel(com.sri.ai.praise.core.representation.classbased.table.core.uai.UAIModel) UAIModelReader(com.sri.ai.praise.core.representation.classbased.table.core.uai.parsing.UAIModelReader) Reader(java.io.Reader)

Aggregations

UAIModel (com.sri.ai.praise.core.representation.classbased.table.core.uai.UAIModel)1 UAIModelReader (com.sri.ai.praise.core.representation.classbased.table.core.uai.parsing.UAIModelReader)1 Reader (java.io.Reader)1