Add wrappers for basic chuffed functions and example program using these wrappers #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is mainly to commit my progress to the main branch. Everything compiles correctly but running main causing an address boundary error that needs to be solved.
I have based main.rs off vendor/examples/template.cpp as this was the simplest chuffed problem I could find. I have implemented the required rust wrappers in lib.rs to implement template.cpp in rust. I think that trying to re create a simple Chuffed problem before trying to implement the XYZ problem will make the process much simpler as I want to stick as close to chuffed as possible to minimize mistakes
My initial approach for figuring out what functions to implement in Rust was to look at the minizinc parser that Chuffed uses. The problem with this is that the entire parser is auto-generated and therefore extremely hard to follow. Instead, I decided that the example cpp files would be a good starting point as those should contain everything necessary to complete some problem.
My approach here is most likely flawed due to my limited knowledge of both cpp and rust so any suggestions to improve this before being merged are greatly appreciated!
Some notes about chuffed:
Problem
class found in each example cpp file is simply a way to organise the problem. The only thing a problem needs to implement is some way to print out/return the output variables.branch
function usually takes in avec<Branching*>
. TheIntVar
type, which is the main type for variables, inherits Branching so I had to create my ownbranch_IntVar
function that takes in avec<IntVar *>
instead of `vec<Branching *>