haskelzinc-0.2.0.1: CP in Haskell through MiniZinc

Copyright(c) Some Guy, 2013 Someone Else, 2014
LicenseGPL-3
MaintainerKlara Marntirosian <klara.mar@cs.kuleuven.be>
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Interfaces.FZSolutionParser

Description

This module parses the solutions outputed by the specified FlatZinc solver. It supports multiple solutions. The parser might fail if there is a show item in the represented MiniZinc model which alters the default format of the solutions' output.

Synopsis

Documentation

getSolution :: Int -> String -> Either ParseError [Solution] Source #

Same as getSolutionFromFile but parses the string argument of the function instead of the contents of a file.

printSolution :: Int -> String -> IO () Source #

Same as printSolutionFromFile but parses the string argument of the function instead of the contents of a file.

getSolutionFromFile :: FilePath -> Int -> IO (Either ParseError [Solution]) Source #

Returns either a parse error or a list of solutions of the constraint model, parsed from the file where they are printed. The length of the list is specified by the second argument of the function.

printSolutionFromFile :: Int -> FilePath -> IO () Source #

Prints either a parse error or a list of solutions of the constraint model parsed from a file where they are printed. The length of the list is sepcified by the second argument of the function.

type Solution = [(String, MValue)] Source #

A Solution consists of a list of pairs. Each pair represents an assignment of a value to a decision variable of the constraint model.

data MValue Source #

Representation of returned values.

Instances