Copyright | (c) Some Guy 2013 Someone Else 2014 |
---|---|
License | BSD3 |
Maintainer | Klara Marntirosian <klara.mar@cs.kuleuven.be> |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides IO functionality for running the Haskell representation of a MiniZinc model and getting back the solutions in Haskell values.
- iTestModel :: MZModel -> IO (Either ParseError [Solution])
- testModel :: MZModel -> FilePath -> Int -> Int -> IO (Either ParseError [Solution])
- testModelWithData :: MZModel -> MZModel -> FilePath -> Int -> Int -> IO (Either ParseError [Solution])
- testModelWithParser :: (Int -> Parser [Solution]) -> MZModel -> FilePath -> Int -> Int -> IO (Either ParseError [Solution])
- writeData :: MZModel -> IO ()
Documentation
iTestModel :: MZModel -> IO (Either ParseError [Solution]) Source #
Same as testModel
, but interactive.
Interactively runs a constraint model and outputs its solution(s). The function first prompts the user for the working directory: the FlatZinc file will be created in that directory. Then, for a name for the constraint model: the created FlatZinc file will be named after this. Also asks the user to choose between supported solvers and the desired number of solutions. Returns either a parse error or a list of solutions of the constraint model. The length of the list is at most equal to the number of solutions requested.
:: MZModel | The model |
-> FilePath | The path of the file in which the FlatZinc translation will be printed (without ".fzn" extension) |
-> Int | The chosen solver ( |
-> Int | The number of solutions to be returned |
-> IO (Either ParseError [Solution]) |
Runs a model and parses its solution(s). Use this function if the model contains no
output
item, so that the solutions have the default format.
:: MZModel | The model |
-> MZModel | The data to be used by the model |
-> FilePath | Path of the file in which the FlatZinc translation will be printed (without ".fzn" extension) |
-> Int | Chosen solver ( |
-> Int | Number of solutions to be returned |
-> IO (Either ParseError [Solution]) |
Same as testModel
but accepts one more argument for the data of the model.
:: (Int -> Parser [Solution]) | The parser with which solutions will be parsed |
-> MZModel | The model |
-> FilePath | The path of the file in which the FlatZinc translation will be printed (without ".fzn" extension) |
-> Int | The chosen solver ( |
-> Int | The number of solutions to be returned |
-> IO (Either ParseError [Solution]) |
Runs a model and parses its solution(s) with the use of the specified parser. Use this function if the model outputs its solutions in a different format than the default.