Comments (4)
Hi,
We have not seen this problem for a long time.
I assume you have changed stack size with the help of -Xss flag for JVM, right? Sometimes, when people have very large number of variables we were seeing this problem and increasing the size of stack was helping in preventing StackOverflow problem.
If -Xss switch does not help in your case then we need to be able to replicate your problem on our machine to be able to figure out the source of the problem.
There were sometimes situation, when for example user configuration of DepthFirstSearch that was not properly providing the choice selection for the search was causing the infinite search depth as each choice was not properly restricting the search space.
best,
Radek
from jacop.
Thanks for getting back to me.
I have not modified the JVM's stack size from the default, and I'm not using a large number of variables (an example with 10 variables and 7 constraints causes the issue).
I have extracted an example CSP that causes the problem into nevik/jacop-recursion-bugtest. It's a Java Maven project that only has JaCoP 4.3 as a dependency and its only Java file creates the CSP situation causing the problem.
A few notes on this:
- The CSP is originally generated by a program from a different representation;
- That causes the weird-looking long variable names;
- and it also causes the redundant/duplicate constraints;
- the "enumerated" integer domains are created as such because that's how it is in the generated code, I've not tested whether this has an effect on the bug (that the so-created domains are contiguous is a special case of this example);
- I'm aware this CSP is very much underconstrained -- however, if this is a problem for JaCoP, I'd like to have a way to find out or get an appropriate exception from JaCoP instead of a JVM-crashing error.
Thanks again and please let me know if this reproduces the problem for you, and if you find any problems with it.
from jacop.
Hi,
Thanks for the program. I was able to replicate your problem.
First, please note that, if you change the domains of the variables from very large number of 2147483647 into 21, and 2147483647 into -21 then you find a solution quickly without a problem.
You are violating the min and maximum value of the int var domain in JaCoP. We should enforce it a bit more rigorously and fail at model creation phase. If you use the following values -50000000 and 50000000 for min and max value of your int vars then again JaCoP is able to find a solution. Those values are currently being used by JaCoP for min and max value allowed in the domain of int var.
Thanks for the report. We will need to add more safety checks to force respecting the min and max values. When those bounds are respected then the search will not exibit the exception you have.
You want to be careful with specifying unnecessary large domains, sometimes depending on the search you choose it may be very detrimental to the search efficiency.
Hope that helps.
best,
Radek
from jacop.
Ahh, that does make sense.
I was previously not careful enough about that, because the problem from which I generate this CSP is not specified entirely over FDVs -- instead, some of the integer variables have base domains that have open (infinite) lower and/or upper bounds (that's what causes Integer.MAX_VALUE
to appear, for example).
I did run into a similar issue when instantiating XplusYeqZ
constraints, which run overflow checks on the variable domains.
I'm looking forward to seeing more checks for this in JaCoP (even if only as assertions), but this was definitely my fault for discounting JaCoP's expectation of finite domains.
Thanks for your help!
from jacop.
Related Issues (20)
- Please make the following protected instead of private HOT 1
- IntDomain should override Domain.clone() to return an IntDomain HOT 1
- IntDomain question HOT 1
- http://jacop.osolpro.com/ no longer functional? HOT 1
- Change request to signatures of Decreasing & Increasing constructors HOT 1
- Change request to XdivYeqZ: make it extend PrimitiveConstraint HOT 3
- Installation problem HOT 1
- Error instead of solution HOT 2
- Empty list in search annotation raises error HOT 1
- Wrong solution HOT 1
- Wrong solution HOT 1
- fzn-jacop, geost_smallest_bb, missing solutions HOT 1
- fzn-jacop, maximum_arg, wrong solution HOT 2
- geost.ObstacleObjectFrame.timeOnlyCheck() should throw FailExceptions instead of using asserts HOT 1
- Confluence is asking for login & password to access the JaCoP website HOT 5
- Error instead of solution HOT 1
- Error instead of solution HOT 1
- CumulativeOptional throws IndexOutOfBoundsExceptions HOT 1
- wrong semantics of `X ^ Y` for negative `Y` HOT 1
- Version 4.11, `f5444652`, `network_flow_cost`: missing solutions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jacop.