CGAL error: precondition violation
When calling BWTA::analyze() I get the following message after a (very long) while:
SDGS is ok... Segment Delaunay graph is ok...CGAL error: precondition violation!
Expression : is_simple()
File : C:\devel\CGAL-4.4\include\CGAL/Polygon_2.h
Line : 332
Explanation:
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html
I followed the tutorial in the 'getting started' page, but using a threaded version simply crashes with no output in the console. So I am simply calling AnalyzeThread() after calling BWTA::readMap(). I've tried calling BWTA::analyze() directly as well, and it produced the same result as above.
I tried it on Benzene, Destination, and Heartbreak Ridge, all returning the same result.
Comments (13)
-
repo owner -
Hi, thanks for the quick reply.
I am not using a Java wrapper and I am compiling using debug mode. I called the AIModuleLoader from a command window with admin privileges and selected the ExampleAIModule.dll file produced from compiling the ExampleAIModule from the 'getting started' page. Then used the 'Chaos Launcher' to start a game with the bot, ticking the 'BWAPI 4.1.2 Injector [DEBUG]' option.
A melee match is started and the output is produced in the console a few minutes after BWTA::analyze() is called, followed by a crash.
EDIT: I compiled using release mode using the file you provided and it works great. Thanks!
-
repo owner Yes, the error only appears in debug mode (preconditions are only checked in debug builds).
Here it is the patched library in debug mode: https://dl.dropboxusercontent.com/u/5164262/BWTAd.lib
Alternatively, you can execute once for each map in release mode to generate BWTA cache data and then in debug mode will load the cache instead of analyzing the whole map again.
PD. Let me know if these patched versions solve your problem
-
repo owner - changed status to resolved
-
Using the patched library in debug mode still produces the same error but takes less time until the error is produced. I can make do with the release version though. Thanks a lot for your help!
-
repo owner - changed status to open
Mmmm ok, thanks for the feedback. I will let the issue open to check again the error using the debug version...
-
@auriarte what flag (macro) in the source code switches the DEBUG checks ON / OFF? Is there anything different between the configurations of Release and Debug?
-
repo owner If _DEBUG is defined (as usually it is in Debug configuration), CGAL checks for some preconditions (like if all the polygons are simple)
-
Oddly enough, I am getting a failed assertion error during a new map analysis although everything (including CGAL 4.7) is compiled in Release:
-
repo owner Mmm strange... are you sure you don't have _DEBUG defined somewhere? But in any case we should fix the assertion violation. Link me the exact map and I will try to track down the error.
-
The DEBUG tip really helped! Thanks! The actual issue turned out to be that I've chosen fp:fast in the C++ project settings. I guess the calculations were wrong...
-
repo owner Nice! I need to find time to remove CGAL or use other algorithms for map decomposition....
-
I seem to get an exception during the analysis (with the debugger attached) of this Hunters version: https://drive.google.com/file/d/0B0DevQUC5MvaSEZEaU1wdlBJZDg/view?usp=sharing The analysis completes eventually though. :) I am using CGAL 4.7 and boost v1.59 if that matters...
CGAL_PROFILER(std::string("Uncertain_conversion_exception thrown for CGAL::Uncertain< ") + typeid(T).name() + " >"); throw Uncertain_conversion_exception( "Undecidable conversion of CGAL::Uncertain<T>");
- Log in to comment
Are you using any wrapper (Java, ...) or compiling/using the debug mode (BWTAd.lib instead of BWTA.lib)? How did you get this output?
This error was detected and fixed, but I haven't released a new version yet. Try to use this one: https://dl.dropboxusercontent.com/u/5164262/BWTA.lib