discreteoptimization / assignment

Assignments and Graders for Discrete Optimization on Coursera
https://www.coursera.org/learn/discrete-optimization
MIT License
95 stars 81 forks source link

add knapsack solver script for binary executable; #45

Open timgluz opened 4 years ago

timgluz commented 4 years ago

Hi,

this PR adds an additional solver.py script to call compiled executable and it passes a content of a test file via stdin. This way a solution doesn't have to deal with file opening & closing;

Testing:

  1. copy knapsack.rs from here: https://gist.github.com/timgluz/0a41ee27e37ccbd68c79400197ba4bf6

  2. compile the example solution: rustc knapsack.rs nb: here's a tutorial how to install Rust: https://www.rust-lang.org/tools/install

  3. test the script: python solverBash.py ./data/ks_4_0

codecov-io commented 4 years ago

Codecov Report

Merging #45 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #45   +/-   ##
=======================================
  Coverage   89.51%   89.51%           
=======================================
  Files          17       17           
  Lines        1059     1059           
=======================================
  Hits          948      948           
  Misses        111      111           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f9df0ce...a3c37d1. Read the comment docs.