haskelzinc-0.2.0.2: CP in Haskell through MiniZinc

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

Interfaces.MZinHaskell

Description

This module integrates constraint solving programming through MiniZinc in Haskell.

Synopsis

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 specified by the number of solutions requested.

testModel Source #

Arguments

:: MZModel

The model

-> FilePath

The path of the file in which the FlatZinc translation will be printed (without ".fzn" extension)

-> Int

The chosen solver (1 for the G12/FD built-in solver or 2 for choco3)

-> Int

The number of solutions to be returned

-> IO (Either ParseError [Solution]) 

Runs a model and parses its solution(s).

testModelWithData Source #

Arguments

:: 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 (1 for the G12/FD built-in solver or 2 for choco3)

-> 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.

writeData :: MZModel -> IO () Source #

Writes the model's data file. The MZModel of the argument must contain only Assignment items.