Closed cokeito closed 4 years ago
can you provide a working example (repo to test) to test this example, and discard an error from my side.
cheers
Hey @cokeito, all of the examples in the readme should work. Are you able to run any examples successfully?
Yep, the flow one ran without problem, i tried to run the Sodoku one and doesn't work neither. i was trying to debug last nite, if u run the solver(mode). it doesn't crash
solver.search_for_all_solutions(model,solution_printer), dies with segfault.
letme know what can i do to provide help for you
ps2: i've tried to run the sodoku example, and got this:
def self.sodoku_test
grid = [
[0, 6, 0, 0, 5, 0, 0, 2, 0],
[0, 0, 0, 3, 0, 0, 0, 9, 0],
[7, 0, 0, 6, 0, 0, 0, 1, 0],
[0, 0, 6, 0, 3, 0, 4, 0, 0],
[0, 0, 4, 0, 7, 0, 1, 0, 0],
[0, 0, 5, 0, 9, 0, 8, 0, 0],
[0, 4, 0, 0, 0, 1, 0, 0, 6],
[0, 3, 0, 0, 0, 8, 0, 0, 0],
[0, 2, 0, 0, 4, 0, 0, 5, 0]
]
sudoku = ORTools::Sudoku.new(grid)
sudoku.solution
end
The Sudoku class is only available on the master branch. You can try cloning the repo and running the test suite.
git clone https://github.com/ankane/or-tools.git
cd or-tools
bundle install
bundle exec rake clobber compile -- --with-or-tools-dir=/path/to/or-tools-cpp-library
bundle exec rake test
Also, make sure the OR-Tools C++ library is 7.7.
Cleaning up stale issues
hey, im back again i've made a service file for testing:
3] pry(main)> DevelService.ejemplo /usr/local/rvm/gems/ruby-2.4.1/gems/or-tools-0.2.0/lib/or_tools/cp_solver.rb:24: [BUG] Segmentation fault at 0x00000000000000 ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
-- Control frame information ----------------------------------------------- c:0057 p:---- s:0338 e:000337 CFUNC :_solve_with_observer c:0056 p:0014 s:0331 e:000330 METHOD /usr/local/rvm/gems/ruby-2.4.1/gems/or-tools-0.2.0/lib/or_tools/cp_solver.rb:24 c:0055 p:0202 s:0325 E:001988 METHOD /home/coke/_prj/turnos-copec/app/services/devel_service.rb:125 c:0054 p:0012 s:0308 E:0019f0 EVAL (pry):3 [FINISH] c:0053 p:---- s:0305 e:000304 CFUNC :eval c:0052 p:0052 s:0298 E:001a70 METHOD /usr/local/rvm/gems/ruby-2.4.1/gems/pry-0.13.1/lib/pry/pry_instance.rb:290 c:0051 p:0292 s:0292 E:001b18 METHOD /usr/local/rvm/gems/ruby-2.4.1/gems/pry-0.13.1/lib/pry/pry_instance.rb:659 c:0050 p:0014 s:0281 E:001c00 BLOCK /usr/local/rvm/gems/ruby-2.4.1/gems/pry-0.13.1/lib/pry/pry_instance.rb:261 [FINISH]