hakank / hakank Goto Github PK
View Code? Open in Web Editor NEWMy public programs and models - mostly combinatorial problems and puzzles
License: MIT License
My public programs and models - mostly combinatorial problems and puzzles
License: MIT License
Hello,
The examples, from sisctus folder, does not work in sicstus prolog 4.0 and below, because the new feature foreach ... param ... was added in sicstus prolog 4.1.
Best regards !
spp.mzn when applying to indirect graph may generate graph loops.
e.g. 1->2, 2->1 may present in the same time in a result.
I might be wrong, but I think your example "https://github.com/hakank/hakank/blob/master/minizinc/jobshop_data/la05.dzn" is not quite right. It should model 10 jobs and 5 machines (not the other way around). Other examples may have the same problem...
Was using your resources (Tom Cruise on an Island):
http://www.hakank.org/eclipse/assignment.ecl
Then saw that the original table reads differently:
You got a row in your examples:
[](7, 8, 8, 4),
But it should be:
[](7, 8, 9, 4),
Error message
GLPSOL--GLPK LP/MIP Solver 5.0
Parameter(s) specified in the command line:
--cpxlp -o __tmp.sol __tmp.lp
Reading problem data from '__tmp.lp'...
__tmp.lp:28: multiple use of variable 'X2' not allowed
CPLEX LP file processing error
*** error(failed,main/0)
hakank/cpmpy/knights_tour_circuit.py
Line 96 in 849d037
should this be: knights_circuit()?
either the call or the function definition should probably change, otherwise undefined
Hi,
Don't take this too serious, but google+ which is still mentioned here:
http://www.hakank.org/
Is meanwhile gone.
Bye
I'm looking to use OR-Tools to replicate your CPMpy model https://github.com/hakank/hakank/blob/master/cpmpy/cabling.py
Lines 177-179, in the second model, say:
for i in range(n):
a,b,num = cable_struct[i]
model += [t[i] == abs(x[a]-x[b])*num]
I believe that the range should be:
for i in range(len(cable_struct)):
The current code returns the correct solution because the example just happens to have n == len(cable_struct)
but that isn't true in general.
Hi Hakan,
I very much like your code. It makes for example good use of Prolog
comments. But I am little bit at loss. What is the license of all that?
Best Regards
I'm sorry for contacting you here, but I'm having some trouble with Picat and I wish ask you for help if you can.
(the question is not strictly related to this repository)
I'm implementing a solver for {log} language in Picat (you can find my code here).
I'm parsing a formula given in input by the user with the picat built-in function parse_term/2
. The formula is made by a list of terms like this: [eq(X,1), ...]
.
The parse_term/2
function returns a term representing my formula, but also a map for name of variables and variables themselves.
My objective is to store this map in a global variable and retrieve it when the solver solves the formula to convert back the variables to their original names.
The problem is that I put the map into a global map using get_global_map().put(k, V)
and then when I retrieve it using get_global_map().get(k)
the keys of this map are unchanged while values (real variables) have changed.
Why this happens? What I'm doing wrong?
Here is where I would convert back variables to their real names:
And here is the function that should convert back variables. Note that this is not working only if I use vars map retrieved from the global map; passing directly the vars map makes this works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.