From rubyforge at lokorin.org Tue Jul 3 08:57:13 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Tue, 03 Jul 2007 14:57:13 +0200 Subject: [gecoder-devel] What architectures do we support? Message-ID: <468A47A9.4090400@lokorin.org> The released files have so far been marked as only supporting i386 to be on the safe side. I suspect that it works on more architectures though, the questions is just on which. I guess it supports the architectures that Rust supports, but I can't find any documentation about which those are. Given that we have no precompiled binaries it might work on any processor, but I have never dealt with the portability questions of C++ before so I will let someone else answer that. -- Andreas Launila From rubyforge at lokorin.org Tue Jul 3 14:00:33 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Tue, 03 Jul 2007 20:00:33 +0200 Subject: [gecoder-devel] Website - graphic design Message-ID: <468A8EC1.2060109@lokorin.org> The graphic design of the website hasn't been an especially high priority, hence the rather ad-hoc appearance. It might be time to do something about that though. If someone would enjoy doing the graphic design of the website then please go ahead. We can also put up a notice on the "project openings"[1] page on RubyForge. It doesn't appear especially active, but I think that it would be a good place to look since the graphic design of a website is a one-time job that doesn't require any knowledge about nor interest in the project. All we really need someone to do in terms of graphic design is to produce a concept-image, which we can then judge and implement. Any thoughts? [1] http://rubyforge.org/people/ -- Andreas Launila From rubyforge at lokorin.org Wed Jul 4 12:44:58 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Wed, 04 Jul 2007 18:44:58 +0200 Subject: [gecoder-devel] [gecoder-commits] [172] trunk: - Relicense bindings to LGPL In-Reply-To: <20070703152932.7C0F25240A79@rubyforge.org> References: <20070703152932.7C0F25240A79@rubyforge.org> Message-ID: <468BCE8A.9050202@lokorin.org> Each of the following three changes seem to cause a segmentation fault when running the specs ("rake specs"). I will revert them for now. There are no development guidelines at the moment, but a good start is probably to run "rake verify_rcov" (which verifies that all test pass and that they have a 100% C0 coverage for the interface) before committing. Running that task requires rcov ( http://eigenclass.org/hiki.rb?rcov ). -- Andreas Launila nobody at rubyforge.org wrote: > Revision > 172 > Author > krawek > Date > 2007-07-03 11:29:32 -0400 (Tue, 03 Jul 2007) > > > Log Message > > - Relicense bindings to LGPL > - Improved (c)reference support > - Fixed rust tests > - Do not uppercase constants > > [...] > > Modified: trunk/vendor/rust/include/rust_conversions.hh (171 => 172) > > > --- trunk/vendor/rust/include/rust_conversions.hh 2007-07-03 15:18:45 UTC (rev 171) > +++ trunk/vendor/rust/include/rust_conversions.hh 2007-07-03 15:29:32 UTC (rev 172) > @@ -67,7 +67,7 @@ > static inline int *ruby2intArray(VALUE rval, int argn = -1) { > int i; > RArray *array = RARRAY(rval); > - int* ret = (int*)malloc(array->len*sizeof(int)); // FIXME: Leak!!! > + int* ret = new int(array->len*sizeof(int)); // FIXME: Leak!!! > for(i = 0; i < array->len; i++) > { > ret[i] = NUM2INT(array->ptr[i]); > > Modified: trunk/vendor/rust/rust/class.rb (171 => 172) > > > --- trunk/vendor/rust/rust/class.rb 2007-07-03 15:18:45 UTC (rev 171) > +++ trunk/vendor/rust/rust/class.rb 2007-07-03 15:29:32 UTC (rev 172) > @@ -229,7 +229,7 @@ > params[:parent] = params[:klass] > super > > - type = Type.new(@parent.namespace.cname+"::"+ at parent.cname) > + type = Type.new(@parent.namespace.cname.to_s+"::"+ at parent.cname.to_s) > > @varname = "f#{type.valid_name}_#{valid_name}" > > @@ -245,8 +245,10 @@ > return "#{raw_call(nparam)}; return Qnil;\n" > else > type = Type.new(@return) > - if not @return.include?("*") and not type.native? > - "return cxx2ruby( new #{@return.gsub("&", "")}(#{raw_call(nparam)}), true );\n" # XXX: needs a copy constructor > + if not type.native? and @return.include?("&") > + "return cxx2ruby( &(#{raw_call(nparam)}), false );\n" > + elsif not @return.include?("*") and not type.native? > + "return cxx2ruby( new #{@return}(#{raw_call(nparam)}), true );\n" > else > "return cxx2ruby( static_cast<#{@return}>(#{raw_call(nparam)}) );\n" > end > > [...] > > Modified: trunk/vendor/rust/rust/function.rb (171 => 172) > > > --- trunk/vendor/rust/rust/function.rb 2007-07-03 15:18:45 UTC (rev 171) > +++ trunk/vendor/rust/rust/function.rb 2007-07-03 15:29:32 UTC (rev 172) > @@ -307,8 +307,10 @@ > return "#{raw_call(nparam)}; return Qnil;\n" > else > type = Type.new(@return) > - if not @return.include?("*") and not type.native? > - "return cxx2ruby( new #{@return.gsub("&", "")}(#{raw_call(nparam)}), true );\n" > + if not type.native? and @return.include?("&") > + "return cxx2ruby( &(#{raw_call(nparam)}), false );\n" > + elsif not @return.include?("*") and not type.native? > + "return cxx2ruby( new #{@return}(#{raw_call(nparam)}), true );\n" > else > "return cxx2ruby( static_cast<#{@return}>(#{raw_call(nparam)}) );\n" > end From rubyforge at lokorin.org Fri Jul 6 09:08:13 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Fri, 06 Jul 2007 15:08:13 +0200 Subject: [gecoder-devel] bools.all, bools.any - slight change of syntax Message-ID: <468E3EBD.5050606@lokorin.org> I have changed the syntax of the constraints that were originally going to be written as bools.any.must... bools.all.must... to bools.disjunction.must... bools.conjunction.must... The reason is that e.g. "bools.all.must_be.false" reads as if each element in bools must be false while it's intended to be that the conjunction of all elements in bools must be false (i.e. at least one element must be false). The latter at least reads correctly to me. There should however exist better names, it's easy to replace the current ones if someone comes up with better. One could change the meaning of "bools.all" to be that each element must satisfy the constraint (n constraints) and "bool.any" that one element must satisfy the constraint (n reified constraints). That would however be more of syntactic sugar for "bools.each{ |b| b.must... }" and "bools.map{ |b| b.must... }.inject{ |reif, constraint| reif | var }", which might be nice to have, but do not bring anything new and are hence probably better done when the requirements are done and an alpha is out. -- Andreas Launila From rubyforge at lokorin.org Fri Jul 6 09:26:51 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Fri, 06 Jul 2007 15:26:51 +0200 Subject: [gecoder-devel] State of development Message-ID: <468E431B.3080100@lokorin.org> I thought it might be useful to give some information of where the development is right now, and what is left. Out of the user requirements[1] the integer and boolean constraints are completed. Left are: * Set variables with their listed constraints. * Branch and bound (optimization search). * Custom propagators and branching. Once that is complete it might be a good idea to see how well everything can be ported to JRuby. After that Gecode/R will satisfy the requirements and will release an alpha version. At that point work will mostly be focused on documentation, providing useful sugar, implementing feedback and fixing bugs. At some point after that a beta stage will come around, focusing on testing. Some examples of useful sugar: * at most, at least, exactly ... m of n reified constraints must hold. * Mixing variable multiplication in linear expressions: (x*y + 3).must == z + 1 * Division, modulo There are probably plenty more. [1] http://gecoder.org/dev/wiki/Requirements -- Andreas Launila From rubyforge at lokorin.org Fri Jul 6 10:52:52 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Fri, 06 Jul 2007 16:52:52 +0200 Subject: [gecoder-devel] Integer set syntax Message-ID: <468E5744.2050706@lokorin.org> During the initial syntax discussion[1] only integer and boolean variables were considered. Now is time to flesh out the syntax for the set variables. These are some suggestions of syntax for the different constraints, feedback is welcome. == Creation http://www.gecode.org/gecode-doc-latest/classGecode_1_1SetVar.html set = set_var(glb_min..glb_max, lub_min..lub_max) * Optionally with cardMin and cardMax. * Optionally with enumerations instead of ranges. == Domain http://www.gecode.org/gecode-doc-latest/group__TaskIntSetDom.html Constant sets may be represented as one of the following * Single integer (singleton set). * Range (set containing all numbers in range), treated differently from other enumerations. * Enumeration of integers (set contaning all numbers in set). In the following examples constant_set is some of the above way to represent a constant set (e.g. 3..17). set_var.must == constant_set set_var.must_be.superset_of constant_set set_var.must_be.subset_of constant_set set_var.must_be.disjoint_with constant_set set_var.must_be.complement_of constant_set * Is "disjoint_with" correct? "set_var.and(constant_set).must_be.disjunct" reads better to me, but breaks too much with the established syntax in my opinion. * Make "superset" an alias of "superset_of" and so on. == Relation http://www.gecode.org/gecode-doc-latest/group__TaskIntSetRel.html Uses the same words as domain but can contain set variables as well as integer variables (representing the corresponding singleton set). I'm not awfully fond of allowing integer variables as left hand sides, e.g. number.must_be.subset_of set Equality, inequality, disjunction and complement are commutative. Subset and supersets can be flipped. So there should be no need for supporting integer variables as left hand sides, removing some possible collision with integer relation constraints. The only constraint left to worry about then is the one that places constraints on each element in a set. Some possibilities: set.each_element.must > number set.each.must > number set.elements.must > number == Distinct http://www.gecode.org/gecode-doc-latest/group__TaskIntSetDistinct.html sets.must_be.distinct_with_size(4) sets.must_be.distinct(:size => 4) # :size is not optional. sets.must.at_most_have_one_in_common_with_size(4) sets.must.at_most_have_one_in_common(:size => 4) # :size not optional. sets.must.at_most_share_one_element(:size => 4) # :size not optional. I'm not sure if any of those are especially clear. == Cardinality http://www.gecode.org/gecode-doc-latest/group__TaskIntSetDom.html#g4517a816bd6db76a41c0b3934161f8bd set.size.must_be.in 4..17 set.size.must_be.in 4 Sort of like the domain constraints for integer variables, but the right hand side must not contain holes. == Selection http://www.gecode.org/gecode-doc-latest/group__TaskIntSetSelection.html === Select set sets[number].must... Feels natural enough considering the element constraints. === The rest sets.union[set].must... sets.intersection[set].must... sets.intersection_with(universe)[set].must... sets.intersection(:with => universe)[set].must... The latter alternative (the one with :with) is probably the better one as it's closer to how sort is handled (sorted, sorted(:as => ...)). I have left out selectDisjoint above, I can't come up with anything fitting for it. Maybe "sets.union(set).must..." should be used instead of the brackets. == Connection http://www.gecode.org/gecode-doc-latest/group__TaskIntSetConnect.html set.min.must... set.max.must... set.must.include(numbers) # This is supposed to be "match". sets.must.channel(numbers) set.size.must... set.weighted(weight_hash).must... * I'm not sure if I understand match correctly here. * The hash in weighted maps integers to integers. * "weighted" should possibly be aliased with "weights_with", "weighted_using". [1] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/254467 -- Andreas Launila From rubyforge at lokorin.org Tue Jul 10 06:55:03 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Tue, 10 Jul 2007 12:55:03 +0200 Subject: [gecoder-devel] Website - graphic design In-Reply-To: <468A8EC1.2060109@lokorin.org> References: <468A8EC1.2060109@lokorin.org> Message-ID: <46936587.9060106@lokorin.org> I have put up a notice on http://rubyforge.org/people/viewjob.php?group_id=3553&job_id=94 . Lets see if someone responds within two weeks. -- Andreas Launila From rubyforge at lokorin.org Tue Jul 10 16:43:35 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Tue, 10 Jul 2007 22:43:35 +0200 Subject: [gecoder-devel] Website - graphic design - submissions Message-ID: <4693EF77.4040003@lokorin.org> This is a thread for submission of concept images in response to a RubyForge job[1]. Please submit submissions as replies to this mail. If you have multiple suggested designs then please split them up into multiple replies. Each submission should contain at least one concept image of the design (i.e. an image showing approximately how the website would look). Discussing the submissions in this mailing list is encouraged. Submissions will be accepted until July 23 2007 23:59 UTC . I will then pick a submission once the resulting discussion has died down. [1] http://rubyforge.org/people/viewjob.php?group_id=3553&job_id=94 -- Andreas Launila From rubyforge at lokorin.org Wed Jul 11 08:29:43 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Wed, 11 Jul 2007 14:29:43 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <4663E535.4090601@lokorin.com> References: <463F8818.8080500@lokorin.com> <465A9DC8.7090702@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> Message-ID: <4694CD37.3050707@lokorin.org> I'm currently trying to add branch and bound (BAB) search, but I have run into a problem. As a part of BAB one has to define a constrain method for the space, which is used by the search to constrain that the next solution has to be better. I have added that to MSpace on the C++ side, but the problem is to get it to invoke a method on the Ruby side. Does anyone have an idea of how to do that with Rust? My progress so far is located in /branches/bab-search . specs/search.rb contains a spec for BAB-search, running it should raise a NoMethodError (raised on the Ruby side), but currently it goes into an endless loop as the constrain method on the C++ side is called (which is empty). -- Andreas Launila From rubyforge at lokorin.org Wed Jul 11 15:08:47 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Wed, 11 Jul 2007 21:08:47 +0200 Subject: [gecoder-devel] Accessing assigned variables In-Reply-To: <4663E535.4090601@lokorin.com> References: <463F8818.8080500@lokorin.com> <465A9DC8.7090702@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> Message-ID: <46952ABF.6050204@lokorin.org> This is a suggestion for changing the way variables are shown to the user and how the user accesses the assigned value of the variable. First of all I think that it was a bad idea to have the free variables delegate to Gecode's classes. I think that they should wrap them instead. The reason is that with delegation we end up with non-Ruby names (currently fixed with aliases) and no RDoc documentation of the variables' methods. So basically I think we should forget about the variable API in Gecode and design completely new APIs for the Ruby side, rather than trying to add things on top of the Gecode API. I can take take IntVar#val as an example, personally I would have called that IntVar#value , but #val is good enough, so it got to stay. Other such things (which are already fixed with aliases) are IntVar#in (IntVar#include?), IntVar#range (IntVar#range?) and so on. Int variables are fairly fine though, set variables are a different story. Beyond camel case and different words I would like to change the way that the properties of the assigned variable are accessed. I would like to make it more similar to the other variables, i.e. have a method SetVar#value which returns something that quacks like Set. The first reason is consistency, if boolean and integer variables both return their assigned values with #value then it would make sense for set variables to do that too. The second is a conflict with SetVar#size which is used for cardinality constraints, meaning that the size of an assigned set otherwise has to be checked with #glb_size, instead of #size. To me set_var.value.size makes it more apparent what one is trying to achieve than set_var.glb_size . It's important to note that these changes would break backward compatibility, but there are plenty of disclaimers saying that we will not hesitate to break backwards compatibility at this stage, so I don't see that as a problem. Any thoughts or comments? A sidenote of a related idea is to add a method "values" to all wrapped enumerables, so that one can use @numbers.values.join(', ') rather than @numbers.map{ |e| e.value }.join(', ') (which is currently common in the examples). -- Andreas Launila From rubyforge at lokorin.org Wed Jul 11 15:15:30 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Wed, 11 Jul 2007 21:15:30 +0200 Subject: [gecoder-devel] Using Gecode::Raw for something useful In-Reply-To: <4663E535.4090601@lokorin.com> References: <463F8818.8080500@lokorin.com> <465A9DC8.7090702@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> Message-ID: <46952C52.5020506@lokorin.org> Just to archive an idea before I forget it: Gecode::Raw is currently set up as an alias of GecodeRaw. It might be interesting to instead optionally have Gecode::Raw as a module which delegates to GecodeRaw (with #method_missing), but only after having logged the call. That way we get an easy way to print out all the Gecode calls that the interface makes, potentially making it easier to spot inefficient translation of e.g. sugar. -- Andreas Launila From rubyforge at lokorin.org Thu Jul 12 05:16:11 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Thu, 12 Jul 2007 11:16:11 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <4694CD37.3050707@lokorin.org> References: <463F8818.8080500@lokorin.com> <465A9DC8.7090702@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> Message-ID: <4695F15B.3070503@lokorin.org> Andreas Launila wrote: > I'm currently trying to add branch and bound (BAB) search, but I have > run into a problem. As a part of BAB one has to define a constrain > method for the space, which is used by the search to constrain that the > next solution has to be better. I have added that to MSpace on the C++ > side, but the problem is to get it to invoke a method on the Ruby side. > Does anyone have an idea of how to do that with Rust? > In case it helps, this is how to do it with SWIG: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/109910 -- Andreas Launila From rubyforge at lokorin.org Thu Jul 12 12:45:21 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Thu, 12 Jul 2007 18:45:21 +0200 Subject: [gecoder-devel] Accessing assigned variables In-Reply-To: <46952ABF.6050204@lokorin.org> References: <463F8818.8080500@lokorin.com> <465A9DC8.7090702@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <46952ABF.6050204@lokorin.org> Message-ID: <46965AA1.5030706@lokorin.org> Andreas Launila wrote: > To me set_var.value.size makes it more apparent what one is > trying to achieve than set_var.glb_size . > Additionally it might be better to use lower_bound, upper_bound instead of glb and lub. I'm not sure that a new user will look at "glb" in the code and understand what it is, "lower_bound" might have a better chance (especially if it returns something that behaves like Set). Not to mention that I keep making errors where I interchange glb and lub. So for instance: set.glb_size becomes set.lower_bound.size -- Andreas Launila From rubyforge at lokorin.org Thu Jul 12 14:06:59 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Thu, 12 Jul 2007 20:06:59 +0200 Subject: [gecoder-devel] Accessing assigned variables In-Reply-To: <46952ABF.6050204@lokorin.org> References: <463F8818.8080500@lokorin.com> <465A9DC8.7090702@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <46952ABF.6050204@lokorin.org> Message-ID: <46966DC3.8040307@lokorin.org> Andreas Launila wrote: > It's important to note that these changes would break backward > compatibility, but there are plenty of disclaimers saying that we will > not hesitate to break backwards compatibility at this stage, so I don't > see that as a problem. > While we're discussing backward compatibility breaking I would also like to change another thing: domain specification for e.g. int variables. Currently int_var(1, 10) creates an integer variable with two possible assignments: 1 and 10. Twice I have spent half an hour trying to find out what's wrong with a constraint only to find that I have written something like int_var(1, 10) instead of int_var(1..10). I think the non-range domains should be specified as enumerables instead, e.g. int_var([1,10]). That way one will at least get an error message. This would also help make the different arguments of int_var_array clearer. Currently one can write things such as int_var_array(3,4,5,1,3) (which means 3 variables with the domain [4,5,1,3]). I think int_var_array(3, [4,5,1,3]) would be clearer. I would in fact want to make that a convention throughout the interface, so that domains arguments and such always allow exactly those forms. Do we want to allow anything beyond ranges and other enums? What about specifying singletons? E.g. should we allow int_var(1) to be the same as int_var([1])? -- Andreas Launila From krawek at gmail.com Thu Jul 12 14:51:32 2007 From: krawek at gmail.com (David Cuadrado) Date: Thu, 12 Jul 2007 13:51:32 -0500 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <4695F15B.3070503@lokorin.org> References: <463F8818.8080500@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> <4695F15B.3070503@lokorin.org> Message-ID: I think you can call the ruby method from c++ using cxx2ruby to get the ruby object and rb_funcall. In the MSpace::constrain method: rb_funcall(Rust_gecode::cxx2ruby(this), rb_intern("constrain"), 1, Rust_gecode::cxx2ruby(s)); do not forget to include gecode.hh 2007/7/12, Andreas Launila : > Andreas Launila wrote: > > I'm currently trying to add branch and bound (BAB) search, but I have > > run into a problem. As a part of BAB one has to define a constrain > > method for the space, which is used by the search to constrain that the > > next solution has to be better. I have added that to MSpace on the C++ > > side, but the problem is to get it to invoke a method on the Ruby side. > > Does anyone have an idea of how to do that with Rust? > > > > In case it helps, this is how to do it with SWIG: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/109910 > > -- > Andreas Launila > From rubyforge at lokorin.org Thu Jul 12 17:50:51 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Thu, 12 Jul 2007 23:50:51 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: References: <463F8818.8080500@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> <4695F15B.3070503@lokorin.org> Message-ID: <4696A23B.3010000@lokorin.org> David Cuadrado wrote: > In the MSpace::constrain method: > > rb_funcall(Rust_gecode::cxx2ruby(this), rb_intern("constrain"), 1, > Rust_gecode::cxx2ruby(s)); > > do not forget to include gecode.hh > It seems to work (it at least recursivly calls itself if no Ruby method is defined). Thanks for the help. constrain does not appear to be called during search though, so I probably made some mistake earlier. I will go back and have another look tomorrow. -- Andreas Launila From rubyforge at lokorin.org Fri Jul 13 10:18:17 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Fri, 13 Jul 2007 16:18:17 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <4696A23B.3010000@lokorin.org> References: <463F8818.8080500@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> <4695F15B.3070503@lokorin.org> <4696A23B.3010000@lokorin.org> Message-ID: <469789A9.6010503@lokorin.org> Andreas Launila wrote: > constrain does not appear to be called during search though, so I > probably made some mistake earlier. I will go back and have another look > tomorrow. > Problem fixed, the constrain method is now being used. The next problem is that no constraint may interact with Gecode outside of the constraint's post method in order for the model to have enough control over the interaction (so that e.g. variables from different spaces don't get mixed up). For the majority of constraints that shouldn't be a problem (they're already written that way), but some old ones bind variables outside of the post method. So that will mainly require adding some sort of safeguard that raises errors if that occurrs, and then fix any offending constraints. -- Andreas Launila From rubyforge at lokorin.org Tue Jul 17 16:27:54 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Tue, 17 Jul 2007 22:27:54 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <469789A9.6010503@lokorin.org> References: <463F8818.8080500@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> <4695F15B.3070503@lokorin.org> <4696A23B.3010000@lokorin.org> <469789A9.6010503@lokorin.org> Message-ID: <469D264A.80909@lokorin.org> Andreas Launila wrote: > The next problem is that no constraint may interact with Gecode outside > of the constraint's post method in order for the model to have enough > control over the interaction (so that e.g. variables from different > spaces don't get mixed up). For the majority of constraints that > shouldn't be a problem (they're already written that way), but some old > ones bind variables outside of the post method. So that will mainly > require adding some sort of safeguard that raises errors if that > occurrs, and then fix any offending constraints. > The above has been implemented and it works for some problems (e.g. the one in the spec). When I was writing an example (send+most=money) I came upon a seg fault though, the same when writing a submission to ruby quiz. So something is still missing. The examples causing the segfaults are located in the example directory in the branches/bab-search branch (called send_most_money.rb and quiz_131.rb). The segfaults come after two and one round in the optimization loop respectively. I'm not used debugging anything below Ruby, so any help is appreciated. I snatched a couple of stacktraces with gdb in case they hint anything. send+most=money: Program received signal SIGSEGV, Segmentation fault. Gecode::Int::Linear::Lq, Gecode::Int::ScaleView >::post (home=0x818fb18, x=@0xbfa28d30, y=@0xbfa28d38, c=-3) at ./gecode/kernel/core.icc:1490 1490 ./gecode/kernel/core.icc: No such file or directory. in ./gecode/kernel/core.icc Current language: auto; currently c++ (gdb) bt #0 Gecode::Int::Linear::Lq, Gecode::Int::ScaleView >::post (home=0x818fb18, x=@0xbfa28d30, y=@0xbfa28d38, c=-3) at ./gecode/kernel/core.icc:1490 #1 0x0095e5a5 in Gecode::Int::Linear::post (home=0x818fb18, e=0xbfa28d80, n=5, r=Gecode::IRT_LQ, c=-3, icl=Gecode::ICL_DEF) at gecode/int/linear/post.cc:145 #2 0x00113ef4 in Gecode::MiniModel::LinExpr::post (this=0x81360f8, home=0x818fb18, irt=Gecode::IRT_GR, icl=Gecode::ICL_DEF) at gecode/minimodel/lin-expr.cc:63 #3 0x002b4486 in Rust_gecode::fMiniModel_LinExpr_post (argc=3, argv=0xbfa29120, self=3086258220) at gecode.cc:3553 #4 0x41024eb8 in rb_provide () from /usr/lib/libruby.so.1.8 ... #48 0x003217da in Gecode::MSpace::constrain (this=0x818fb18, s=0x818c880) at missing.cpp:202 #49 0x002a7e52 in Rust_gecode::fGecodeRaw_MBAB_next (self=3085923400) at /usr/local/include/gecode/search/bab.icc:76 ... quiz 131: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1208191296 (LWP 8461)] Rust_gecode::fGecodeRawweights (self=3086693100, home=3086267780, elements=3086258660, weights=3086257720, x=3086255020, y=4) at /usr/local/include/gecode/int/var/int.icc:30 30 : var(x.var) {} Current language: auto; currently c++ (gdb) bt #0 Rust_gecode::fGecodeRawweights (self=3086693100, home=3086267780, elements=3086258660, weights=3086257720, x=3086255020, y=4) at /usr/local/include/gecode/int/var/int.icc:30 #1 0x41024e2c in rb_provide () from /usr/lib/libruby.so.1.8 ... #42 0x001a47da in Gecode::MSpace::constrain (this=0x81f0c30, s=0x81fafc8) at missing.cpp:202 #43 0x0012ae52 in Rust_gecode::fGecodeRaw_MBAB_next (self=3086267940) at /usr/local/include/gecode/search/bab.icc:76 ... -- Andreas Launila From rubyforge at lokorin.org Wed Jul 18 13:13:38 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Wed, 18 Jul 2007 19:13:38 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <469D264A.80909@lokorin.org> References: <463F8818.8080500@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> <4695F15B.3070503@lokorin.org> <4696A23B.3010000@lokorin.org> <469789A9.6010503@lokorin.org> <469D264A.80909@lokorin.org> Message-ID: <469E4A42.2040801@lokorin.org> Andreas Launila wrote: > The above has been implemented and it works for some problems (e.g. the > one in the spec). When I was writing an example (send+most=money) I came > upon a seg fault though, the same when writing a submission to ruby > quiz. So something is still missing. The examples causing the segfaults > are located in the example directory in the branches/bab-search branch > (called send_most_money.rb and quiz_131.rb). The segfaults come after > two and one round in the optimization loop respectively. I have added an example example/spec2_ex.rb which is also part of the specs. It tries to maximize the value of a number with three distinct digits, where the digits are integer variable with domain 0..9. It branches by picking the smallest value first, hence it has to go through many nodes. It seems to partly give segfaults (after a varying number of nodes have been searched through) and partly other errors such as ./example/../lib/gecoder/interface/search.rb:65:in `bab': undefined method `constrain' for []:Array (NoMethodError) from ./example/../lib/gecoder/interface/search.rb:65:in `optimize!' from example/spec2_ex.rb:22 The latter type of error seems to be connected to Ruby's garbage collection. Adding "GC.start" last in the optimize! block in the example (line 25 currently) seems to consistently give the same error after the same number of nodes have been explored. My guess is that "Rust_gecode::cxx2ruby(this)" evaluates to something that is not a Ruby space after garbage collection. Disabling garbage collection during the bab-search seems to make example/spec2_ex.rb pass (but segfaults in other examples remain). A question is probably whether this is Rust not playing nice with garbage collection or whether it's something missing in the interface/bindings. -- Andreas Launila From rubyforge at lokorin.org Wed Jul 18 16:23:51 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Wed, 18 Jul 2007 22:23:51 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <469E4A42.2040801@lokorin.org> References: <463F8818.8080500@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> <4695F15B.3070503@lokorin.org> <4696A23B.3010000@lokorin.org> <469789A9.6010503@lokorin.org> <469D264A.80909@lokorin.org> <469E4A42.2040801@lokorin.org> Message-ID: <469E76D7.6040008@lokorin.org> Andreas Launila wrote: > A question is probably whether this is Rust not playing nice with > garbage collection or whether it's something missing in the > interface/bindings. > Rust at least seems to care about garbage collection. For now garbage collection is temporarily disabled while performing the bab-search. Additionally the space parameter given to constrain is no longer put under Ruby GC control (otherwise one gets a segfault when Rust tries to free it after Gecode::bab managed to do it first). All in all the second spec example now passes. The send+most=money and quiz examples still segfaults though. -- Andreas Launila From rubyforge at lokorin.org Thu Jul 19 16:36:14 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Thu, 19 Jul 2007 22:36:14 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <469E76D7.6040008@lokorin.org> References: <463F8818.8080500@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> <4695F15B.3070503@lokorin.org> <4696A23B.3010000@lokorin.org> <469789A9.6010503@lokorin.org> <469D264A.80909@lokorin.org> <469E4A42.2040801@lokorin.org> <469E76D7.6040008@lokorin.org> Message-ID: <469FCB3E.2070809@lokorin.org> Andreas Launila wrote: > All in all the second spec example now passes. The send+most=money and > quiz examples still segfaults though. > Various problems have been fixed to the point where the quiz example now works on small inputs. Removing the caching of variables seems to bring out more segfaults as garbage collection is more active then. send+most=money still segfaults, and does so consistently at the same point every time, so it's probably a different issue. -- Andreas Launila From rubyforge at lokorin.org Fri Jul 20 14:17:08 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Fri, 20 Jul 2007 20:17:08 +0200 Subject: [gecoder-devel] Bindings - problem adding branch and bound search In-Reply-To: <469FCB3E.2070809@lokorin.org> References: <463F8818.8080500@lokorin.com> <465B431E.7010503@lokorin.com> <465D8011.3030702@lokorin.com> <4661A7DE.9030901@lokorin.com> <4663E535.4090601@lokorin.com> <4694CD37.3050707@lokorin.org> <4695F15B.3070503@lokorin.org> <4696A23B.3010000@lokorin.org> <469789A9.6010503@lokorin.org> <469D264A.80909@lokorin.org> <469E4A42.2040801@lokorin.org> <469E76D7.6040008@lokorin.org> <469FCB3E.2070809@lokorin.org> Message-ID: <46A0FC24.9030608@lokorin.org> Andreas Launila wrote: > send+most=money still segfaults, and does so consistently at the same > point every time, so it's probably a different issue. > Last few problems fixed, examples work, specs pass. -- Andreas Launila From chrisgarcia001 at hotmail.com Fri Jul 20 17:15:47 2007 From: chrisgarcia001 at hotmail.com (Christopher Garcia) Date: Fri, 20 Jul 2007 21:15:47 +0000 Subject: [gecoder-devel] Trouble Installing Gecoder Message-ID: Can anyone help me -- I'm having some problems installing Gecoder. I have installed the Gecode MSI on windows and am now trying to install Gecoder by using the gem as specified in the installation instructions:> gem install gecoderI get the following error -- can anyone help me resolve this?:C:\>gem install gecoderBulk updating Gem source index for: http://gems.rubyforge.orgBuilding native extensions. This could take a while...*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers. Check the mkmf.log file for moredetails. You may need configuration options.Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --srcdir=. --curdir --ruby=c:/ruby/bin/ruby --with-gecodeintlib --without-gecodeintlib --with-gecodekernellib --without-gecodekernellib --with-gecodeminimodellib --without-gecodeminimodellib --with-gecodesearchlib --without-gecodesearchlib --with-gecodesetlib --without-gecodesetlibERROR: While executing gem ... (RuntimeError) ERROR: Failed to build gem native extension.Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/gecoder-0.6.0 for inspection.Results logged to c:/ruby/lib/ruby/gems/1.8/gems/gecoder-0.6.0/ext/gem_make.outThanks!Chris _________________________________________________________________ Don't get caught with egg on your face. Play Chicktionary!?? http://club.live.com/chicktionary.aspx?icid=chick_wlmailtextlink -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/gecoder-devel/attachments/20070720/10eb6961/attachment.html From rubyforge at lokorin.org Fri Jul 20 18:39:16 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Sat, 21 Jul 2007 00:39:16 +0200 Subject: [gecoder-devel] Trouble Installing Gecoder In-Reply-To: References: Message-ID: <46A13994.8020202@lokorin.org> What do the mkmf.log and gem_make.out files say? I'm moving this discussion to gecoder-users as it's probably better suited there. -- Andreas Launila Christopher Garcia wrote: > Can anyone help me -- I'm having some problems installing Gecoder. I > have installed the Gecode MSI on windows and am now trying to install > Gecoder by using the gem as specified in the installation instructions: > >> gem install gecoder > > I get the following error -- can anyone help me resolve this?: > > > C:\>gem install gecoder > Bulk updating Gem source index for: http://gems.rubyforge.org > Building native extensions. This could take a while... > *** extconf.rb failed *** > Could not create Makefile due to some reason, probably lack of > necessary libraries and/or headers. Check the mkmf.log file for more > details. You may need configuration options. > > Provided configuration options: > --with-opt-dir > --without-opt-dir > --with-opt-include > --without-opt-include=${opt-dir}/include > --with-opt-lib > --without-opt-lib=${opt-dir}/lib > --with-make-prog > --srcdir=. > --curdir > --ruby=c:/ruby/bin/ruby > --with-gecodeintlib > --without-gecodeintlib > --with-gecodekernellib > --without-gecodekernellib > --with-gecodeminimodellib > --without-gecodeminimodellib > --with-gecodesearchlib > --without-gecodesearchlib > --with-gecodesetlib > --without-gecodesetlib > > ERROR: While executing gem ... (RuntimeError) > ERROR: Failed to build gem native extension. > Gem files will remain installed in > c:/ruby/lib/ruby/gems/1.8/gems/gecoder-0.6.0 for inspection. > > > Results logged to > c:/ruby/lib/ruby/gems/1.8/gems/gecoder-0.6.0/ext/gem_make.out > > > Thanks! > > Chris From rubyforge at lokorin.org Tue Jul 24 04:10:25 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Tue, 24 Jul 2007 10:10:25 +0200 Subject: [gecoder-devel] Website - graphic design In-Reply-To: <46936587.9060106@lokorin.org> References: <468A8EC1.2060109@lokorin.org> <46936587.9060106@lokorin.org> Message-ID: <46A5B3F1.4040608@lokorin.org> Andreas Launila wrote: > I have put up a notice on > http://rubyforge.org/people/viewjob.php?group_id=3553&job_id=94 . Lets > see if someone responds within two weeks. > No response, so the current design will have to remain until someone suggests a better one. -- Andreas Launila From rubyforge at lokorin.org Tue Jul 31 15:34:50 2007 From: rubyforge at lokorin.org (Andreas Launila) Date: Tue, 31 Jul 2007 21:34:50 +0200 Subject: [gecoder-devel] Website - graphic design In-Reply-To: <468A8EC1.2060109@lokorin.org> References: <468A8EC1.2060109@lokorin.org> Message-ID: <46AF8EDA.3040200@lokorin.org> Andreas Launila wrote: > The graphic design of the website hasn't been an especially high > priority, hence the rather ad-hoc appearance. It might be time to do > something about that though. Here's something I threw together: http://lokorin.org/gecoder/concept.png It uses the tabs on top for the main navigation (they remain there at all times). It has breadcrumbs below it (useful when we step into the third level). The secondary navigation is located in the bottom right below the search box. It's very basic and unpolished. Someone who fancies improving it might find the raw GIMP file located at http://lokorin.org/gecoder/concept.xcf useful. My opinions: * The breaking of the header's gray directly to the white seems too direct, a small gradiant might make it less distracting. * The logo was meant to be a ruby with a constraint/restraint across it, I'm not sure how well it comes across though. Better logo suggestions, or someone better at creating them would be good. * I have trouble balancing relative font sizes and margins to make things readable. I'm sure that someone better at it could tweak the headers and margins to improve the readability. * The summary (might not exist on every page) should perhaps be distinguished with something other than font size (it's slightly larger than the other text). Perhaps it should be contained in a box or have a divider below it. * The right column feels too light compared to the left. Something could perhaps be done with the navigation links or something could be added to it. Perhaps the search box should be below the navigation? * Perhaps a non-white background would improve? I.e. the text would be on white background but the currently empty space to the right and left would have some other color. What is your opinion? -- Andreas Launila