Giter Site home page Giter Site logo

mistral-2.0's People

Contributors

ehebrard avatar siala avatar timmifixedit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mistral-2.0's Issues

FlatZinc interface: Missing output

I'm trying to use the FlatZinc solver according to the instructions in fz/README. I've compiled mistral-fzn using make, and the binary seems to work. Both -h and --version give the correct output, both using mistral-fzn and mistral-fz.

However, when I run mistral on an actual FlatZinc file, I'm not getting any results.
I'm using a simple model:

include "all_different.mzn";
array[1..4] of var 1..4: x;
constraint all_different(x);
solve maximize sum(x);

which flattens down to:

array [1..2] of int: X_INTRODUCED_5_ = [1,-1];
var 1..4: X_INTRODUCED_0_;
var 1..4: X_INTRODUCED_1_;
var 1..4: X_INTRODUCED_2_;
var 1..4: X_INTRODUCED_3_;
var 4..16: X_INTRODUCED_4_:: is_defined_var;
array [1..4] of var int: x:: output_array([1..4]) = [X_INTRODUCED_0_,X_INTRODUCED_1_,X_INTRODUCED_2_,X_INTRODUCED_3_];
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_0_,X_INTRODUCED_1_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_0_,X_INTRODUCED_2_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_0_,X_INTRODUCED_3_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_1_,X_INTRODUCED_2_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_1_,X_INTRODUCED_3_],0);
constraint int_lin_ne(X_INTRODUCED_5_,[X_INTRODUCED_2_,X_INTRODUCED_3_],0);
constraint int_lin_eq([1,1,1,1,-1],[X_INTRODUCED_0_,X_INTRODUCED_1_,X_INTRODUCED_2_,X_INTRODUCED_3_,X_INTRODUCED_4_],0):: ctx_pos:: defines_var(X_INTRODUCED_4_);
solve  maximize X_INTRODUCED_4_;

Running ./mistral-fz test.fzn does not give any output.

Directly running ./mistral-fzn test.fzn does give output, but does not seem to output any results:

 d PARSETIME 0
 c Maximize r10
 c +===========================================+
 c |       17         182        0 |        10 | 
 c +===========================================+

Did I do anything wrong? Am I missing some step in mistral's compilation?

Mistral eats up my memory

Hi there, I have a fzn-File which uses all my memory while reading it in with Mistral (trunk, Linux 64-bit). See http://www.datafilehost.com/d/fe1e1c15 (tgz, sorry, found no better place to upload file). I think there's something going wrong because with another files about the same size but with "solve minimize ;" everything works.
Hey, and: Keep up the good work!

Compilation Fails

Cloned the repository on a 16.10 Ubuntu machine.

issuing the command

~$ make

from within Minstral-2.0 directory yields a long list of errors, which you can find attached in out.txt.

It looks like the repository is pointing at two other external repositories which are no longer existing.

clang-10 fails to build mistral: no viable overloaded '='

g++ -Wall -std=c++11 -I./src/include -I./tools/tclap/include  -O3  -D_UNIX -D_BIT32   -c src/lib/mistral_variable.cpp -o src/obj/mistral_variable.o 
In file included from src/lib/mistral_solver.cpp:21:
In file included from /usr/include/c++/v1/sstream:173:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:215:
In file included from /usr/include/c++/v1/__locale:14:
In file included from /usr/include/c++/v1/string:504:
In file included from /usr/include/c++/v1/string_view:175:
In file included from /usr/include/c++/v1/__string:57:
/usr/include/c++/v1/algorithm:2027:18: error: no viable overloaded '='
        *__first = __value_;
        ~~~~~~~~ ^ ~~~~~~~~
/usr/include/c++/v1/algorithm:2036:18: note: in instantiation of function template specialization 'std::__1::__fill_n<Mistral::Vector<Mistral::Variable> *, long, nullptr_t>' requested here
   return _VSTD::__fill_n(__first, __convert_to_integral(__n), __value_);
                 ^
/usr/include/c++/v1/algorithm:2055:12: note: in instantiation of function template specialization 'std::__1::fill_n<Mistral::Vector<Mistral::Variable> *, long, nullptr_t>' requested here
    _VSTD::fill_n(__first, __last - __first, __value_);
           ^
/usr/include/c++/v1/algorithm:2063:12: note: in instantiation of function template specialization 'std::__1::__fill<Mistral::Vector<Mistral::Variable> *, nullptr_t>' requested here
    _VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category());
           ^
./src/include/mistral_search.hpp:2603:7: note: in instantiation of function template specialization 'std::__1::fill<Mistral::Vector<Mistral::Variable> *, nullptr_t>' requested here
        std::fill(neighborhood, neighborhood+n, NULL);
             ^
./src/include/mistral_search.hpp:2575:5: note: in instantiation of member function 'Mistral::GenericNeighborDVO<SelfPlusAverage, Mistral::MinDomainOverWeight, 1,
      Mistral::ConflictCountManager>::initialise' requested here
    GenericNeighborDVO() : GenericDVO< Aggregator< VarComparator >, RAND, WeightManager >() { neighborhood=NULL; }
    ^
./src/include/mistral_search.hpp:1521:5: note: in instantiation of member function 'Mistral::GenericNeighborDVO<SelfPlusAverage, Mistral::MinDomainOverWeight, 1,
      Mistral::ConflictCountManager>::GenericNeighborDVO' requested here
    GenericHeuristic(Solver *s) 
    ^
src/lib/mistral_solver.cpp:7798:20: note: in instantiation of member function 'Mistral::GenericHeuristic<Mistral::GenericNeighborDVO<SelfPlusAverage, Mistral::MinDomainOverWeight, 1,
      Mistral::ConflictCountManager>, Mistral::AnyValue>::GenericHeuristic' requested here
                heu = new GenericHeuristic< GenericNeighborDVO < SelfPlusAverage, MinDomainOverWeight, 1, ConflictCountManager >, AnyValue > (this);
                          ^
./src/include/mistral_structure.hpp:685:33: note: candidate function not viable: no known conversion from 'const nullptr_t' to 'const Vector<Mistral::Variable>' for 1st argument
    inline Vector< DATA_TYPE >& operator=(const Vector< DATA_TYPE >& x)
                                ^
In file included from src/lib/mistral_solver.cpp:27:
In file included from ./src/include/mistral_sat.hpp:34:
In file included from ./src/include/mistral_search.hpp:33:
In file included from ./src/include/mistral_solver.hpp:32:
./src/include/mistral_constraint.hpp:748:19: warning: array index 2 is past the end of the array (which contains 2 elements) [-Warray-bounds]
                                os << ", " << scope[2];
                                              ^     ~
./src/include/mistral_constraint.hpp:760:5: note: in instantiation of member function 'Mistral::FixedArityConstraint<2>::display' requested here
    BinaryConstraint() : FixedArityConstraint<2>() {}
    ^
./src/include/mistral_constraint.hpp:460:5: note: array 'scope' declared here
    Variable scope[ARITY];
    ^

OS: FreeBSD 12.2

Printing original variablenames with option --print_mod

Hi,
I'd like to simplify a FZN-Model with Mistral. --print_mod prints out constraints and varnames of a simplified model in an internal notation. Translation of these constraints to Flatzinc would not be the problem to me, but varnames like b2513 and r2162 get me a headache. I'm not a C++-Coder, so I searched for a hint how to get the original varnames into this output, but in vain.
Could you give me a hint how to do that (Filename, Method)? That would be great!
Thank you
Alex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.